mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-04-28 07:19:47 +00:00
Improve initial log file (#105)
This commit is contained in:
parent
e4b8487945
commit
12602ba8dd
@ -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)
|
||||||
@ -155,6 +163,9 @@ async fn main() {
|
|||||||
.start().expect("Cannot start logging");
|
.start().expect("Cannot start logging");
|
||||||
|
|
||||||
info!("Starting MindWork AI Studio:");
|
info!("Starting MindWork AI Studio:");
|
||||||
|
let working_directory = std::env::current_dir().unwrap();
|
||||||
|
info!(".. The working directory is: '{working_directory:?}'");
|
||||||
|
|
||||||
info!(".. Version: v{app_version} (commit {app_commit_hash}, build {build_number})");
|
info!(".. Version: v{app_version} (commit {app_commit_hash}, build {build_number})");
|
||||||
info!(".. Build time: {build_time}");
|
info!(".. Build time: {build_time}");
|
||||||
info!(".. .NET SDK: v{dotnet_sdk_version}");
|
info!(".. .NET SDK: v{dotnet_sdk_version}");
|
||||||
@ -190,7 +201,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