mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-04-28 21:19:47 +00:00
Hide the initial log file on Unix-like systems
This commit is contained in:
parent
e4b8487945
commit
f323c85276
@ -142,9 +142,17 @@ async fn main() {
|
|||||||
// Set the log level for the Reqwest library:
|
// Set the log level for the Reqwest library:
|
||||||
log_config.push_str("reqwest::async_impl::client=info");
|
log_config.push_str("reqwest::async_impl::client=info");
|
||||||
|
|
||||||
|
// Configure the initial filename. On Unix systems, the file should start
|
||||||
|
// with a dot to be hidden.
|
||||||
|
let log_basename = match cfg!(unix)
|
||||||
|
{
|
||||||
|
true => ".AI Studio Events",
|
||||||
|
false => "AI Studio Events",
|
||||||
|
};
|
||||||
|
|
||||||
let logger = Logger::try_with_str(log_config).expect("Cannot create logging")
|
let logger = Logger::try_with_str(log_config).expect("Cannot create logging")
|
||||||
.log_to_file(FileSpec::default()
|
.log_to_file(FileSpec::default()
|
||||||
.basename("AI Studio Events")
|
.basename(log_basename)
|
||||||
.suppress_timestamp()
|
.suppress_timestamp()
|
||||||
.suffix("log"))
|
.suffix("log"))
|
||||||
.duplicate_to_stdout(Duplicate::All)
|
.duplicate_to_stdout(Duplicate::All)
|
||||||
@ -190,7 +198,7 @@ async fn main() {
|
|||||||
let mut shutdown = Shutdown {
|
let mut shutdown = Shutdown {
|
||||||
// We do not want to use the Ctrl+C signal to stop the server:
|
// We do not want to use the Ctrl+C signal to stop the server:
|
||||||
ctrlc: false,
|
ctrlc: false,
|
||||||
|
|
||||||
// Everything else is set to default for now:
|
// Everything else is set to default for now:
|
||||||
..Shutdown::default()
|
..Shutdown::default()
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user