mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Place date at the begining of the log file name
This commit is contained in:
parent
5da9f93ff7
commit
9b41568881
@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
- Made dungeon tiers 3, 4, and 5 more common
|
- Made dungeon tiers 3, 4, and 5 more common
|
||||||
|
- Put date at the begining of the log file instead of the end to allow MIME type recognition
|
||||||
- Tweaked CR and exp calculation formula
|
- Tweaked CR and exp calculation formula
|
||||||
|
|
||||||
### Removed
|
### Removed
|
||||||
|
@ -113,7 +113,7 @@ where
|
|||||||
if let Some((path, file)) = log_path_file {
|
if let Some((path, file)) = log_path_file {
|
||||||
match fs::create_dir_all(path) {
|
match fs::create_dir_all(path) {
|
||||||
Ok(_) => {
|
Ok(_) => {
|
||||||
let file_appender = tracing_appender::rolling::daily(path, file);
|
let file_appender = tracing_appender::rolling::never(path, file); // It is actually rolling daily since the log name is changing daily
|
||||||
let (non_blocking_file, file_guard) = tracing_appender::non_blocking(file_appender);
|
let (non_blocking_file, file_guard) = tracing_appender::non_blocking(file_appender);
|
||||||
guards.push(file_guard);
|
guards.push(file_guard);
|
||||||
file_setup = true;
|
file_setup = true;
|
||||||
|
@ -19,6 +19,7 @@ use veloren_voxygen::{
|
|||||||
GlobalState,
|
GlobalState,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
use chrono::Utc;
|
||||||
#[cfg(feature = "hot-reloading")]
|
#[cfg(feature = "hot-reloading")]
|
||||||
use common::assets;
|
use common::assets;
|
||||||
use common::clock::Clock;
|
use common::clock::Clock;
|
||||||
@ -39,8 +40,9 @@ fn main() {
|
|||||||
.unwrap_or_else(|| userdata_dir.join("voxygen").join("logs"));
|
.unwrap_or_else(|| userdata_dir.join("voxygen").join("logs"));
|
||||||
|
|
||||||
// Init logging and hold the guards.
|
// Init logging and hold the guards.
|
||||||
const LOG_FILENAME: &str = "voxygen.log";
|
let now = Utc::now();
|
||||||
let _guards = common_frontend::init_stdout(Some((&logs_dir, LOG_FILENAME)));
|
let log_filename = format!("{}_voxygen.log", now.format("%Y-%m-%d"));
|
||||||
|
let _guards = common_frontend::init_stdout(Some((&logs_dir, &log_filename)));
|
||||||
|
|
||||||
info!("Using userdata dir at: {}", userdata_dir.display());
|
info!("Using userdata dir at: {}", userdata_dir.display());
|
||||||
|
|
||||||
@ -117,7 +119,7 @@ fn main() {
|
|||||||
Panic Payload: {:?}\n\
|
Panic Payload: {:?}\n\
|
||||||
PanicInfo: {}\n\
|
PanicInfo: {}\n\
|
||||||
Game version: {} [{}]",
|
Game version: {} [{}]",
|
||||||
logs_dir.join("voxygen.log.<date>").display(),
|
logs_dir.join(&log_filename).display(),
|
||||||
reason,
|
reason,
|
||||||
panic_info,
|
panic_info,
|
||||||
common::util::GIT_HASH.to_string(),
|
common::util::GIT_HASH.to_string(),
|
||||||
|
Loading…
Reference in New Issue
Block a user