mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
fix: 040 bugs (#4285)
* test: add tests * chore: set maximum log files * fix: import row document * chore: bump client api * chore: fix analyzer * chore: fix flutter unit test
This commit is contained in:
@ -9,7 +9,7 @@ edition = "2018"
|
||||
|
||||
tracing-subscriber = { version = "0.3.17", features = ["registry", "env-filter", "ansi", "json"] }
|
||||
tracing-bunyan-formatter = "0.3.9"
|
||||
tracing-appender = "0.2.2"
|
||||
tracing-appender = "0.2.3"
|
||||
tracing-core = "0.1"
|
||||
tracing.workspace = true
|
||||
serde_json.workspace = true
|
||||
|
@ -3,6 +3,7 @@ use std::sync::RwLock;
|
||||
use chrono::Local;
|
||||
use lazy_static::lazy_static;
|
||||
use tracing::subscriber::set_global_default;
|
||||
use tracing_appender::rolling::Rotation;
|
||||
use tracing_appender::{non_blocking::WorkerGuard, rolling::RollingFileAppender};
|
||||
use tracing_bunyan_formatter::JsonStorageLayer;
|
||||
use tracing_subscriber::fmt::format::Writer;
|
||||
@ -25,10 +26,17 @@ pub struct Builder {
|
||||
|
||||
impl Builder {
|
||||
pub fn new(name: &str, directory: &str) -> Self {
|
||||
let file_appender = RollingFileAppender::builder()
|
||||
.rotation(Rotation::DAILY)
|
||||
.filename_prefix(name)
|
||||
.max_log_files(6)
|
||||
.build(directory)
|
||||
.unwrap_or(tracing_appender::rolling::daily(directory, name));
|
||||
|
||||
Builder {
|
||||
name: name.to_owned(),
|
||||
env_filter: "Info".to_owned(),
|
||||
file_appender: tracing_appender::rolling::daily(directory, name),
|
||||
file_appender,
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user