Add log rotation (#6564)

* Use flexi_logger; Add log rotation

* Add default rotation; Add FlexiLogger error

* Fix compilation error

* Remove logging to stdout if it's not a tty

* Fix formatting

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* Remove needless debug statement

* Default to unlimited size for log rotation

* Add more comments about log-age option

* Remove unused variable

* Fix typo in comment

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
This commit is contained in:
pscott
2020-07-08 12:11:09 +02:00
committed by GitHub
parent 62f306d972
commit 6eb2eb81c5
8 changed files with 324 additions and 84 deletions
+4 -1
View File
@@ -63,6 +63,9 @@ struct Opt {
#[structopt(long)]
transactions: Option<usize>,
#[structopt(flatten)]
log_rotation_opt: sc_cli::LogRotationOpt,
/// Mode
///
/// "regular" for regular benchmark
@@ -77,7 +80,7 @@ fn main() {
let opt = Opt::from_args();
if !opt.json {
sc_cli::init_logger("");
sc_cli::init_logger("", &opt.log_rotation_opt).expect("init_logger should not fail.");
}
let mut import_benchmarks = Vec::new();