File tree Expand file tree Collapse file tree 5 files changed +98
-4
lines changed Expand file tree Collapse file tree 5 files changed +98
-4
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,7 @@ sloggers = "=2.2.0"
78
78
log4rs = " =1.3.0"
79
79
fern = " =0.6.2"
80
80
flexi_logger = " =0.28.3"
81
+ ftlog = " =0.2.14"
81
82
tracing = " =0.1.40"
82
83
tracing-subscriber = " =0.3.18"
83
84
tracing-appender = " =0.2.3"
@@ -93,25 +94,34 @@ required-features = ["multi-thread"]
93
94
[[bench ]]
94
95
name = " spdlog_rs"
95
96
path = " benches/spdlog-rs/spdlog_rs.rs"
96
-
97
97
[[bench ]]
98
98
name = " spdlog_rs_compare_with_cpp_spdlog"
99
99
path = " benches/spdlog-rs/compare_with_cpp_spdlog.rs"
100
100
harness = false
101
-
102
101
[[bench ]]
103
102
name = " spdlog_rs_compare_with_cpp_spdlog_async"
104
103
path = " benches/spdlog-rs/compare_with_cpp_spdlog_async.rs"
105
104
harness = false
106
-
107
105
[[bench ]]
108
106
name = " spdlog_rs_pattern"
109
107
path = " benches/spdlog-rs/pattern.rs"
108
+ [[bench ]]
109
+ name = " ftlog"
110
+ path = " benches/ftlog/main.rs"
111
+ harness = false
112
+ [[bench ]]
113
+ name = " ftlog_1_file_async"
114
+ path = " benches/ftlog/1_file_async.rs"
115
+ [[bench ]]
116
+ name = " ftlog_2_rotating_daily"
117
+ path = " benches/ftlog/2_rotating_daily.rs"
118
+ [[bench ]]
119
+ name = " ftlog_3_level_off"
120
+ path = " benches/ftlog/3_level_off.rs"
110
121
111
122
[[example ]]
112
123
name = " 06_compatible_with_log_crate"
113
124
required-features = [" log" ]
114
-
115
125
[[example ]]
116
126
name = " 07_async_pool_sink"
117
127
required-features = [" multi-thread" ]
Original file line number Diff line number Diff line change
1
+ #![ feature( test) ]
2
+
3
+ extern crate test;
4
+
5
+ #[ path = "../common/mod.rs" ]
6
+ mod common;
7
+
8
+ use ftlog:: appender:: FileAppender ;
9
+ use log:: info;
10
+ use test:: Bencher ;
11
+
12
+ unavailable_bench ! ( bench_1_file) ;
13
+
14
+ #[ bench]
15
+ fn bench_2_file_async ( bencher : & mut Bencher ) {
16
+ let path = common:: BENCH_LOGS_PATH . join ( "file_async.log" ) ;
17
+
18
+ let _guard = ftlog:: builder ( )
19
+ . root ( FileAppender :: builder ( ) . path ( path) . build ( ) )
20
+ . try_init ( )
21
+ . unwrap ( ) ;
22
+
23
+ bencher. iter ( || info ! ( bench_log_message!( ) ) )
24
+ }
25
+
26
+ unavailable_bench ! ( bench_3_rotating_file_size) ;
Original file line number Diff line number Diff line change
1
+ #![ feature( test) ]
2
+
3
+ extern crate test;
4
+
5
+ #[ path = "../common/mod.rs" ]
6
+ mod common;
7
+
8
+ use ftlog:: appender:: { FileAppender , Period } ;
9
+ use log:: info;
10
+ use test:: Bencher ;
11
+
12
+ #[ bench]
13
+ fn bench_4_rotating_daily ( bencher : & mut Bencher ) {
14
+ let path = common:: BENCH_LOGS_PATH . join ( "rotating_daily.log" ) ;
15
+
16
+ let _guard = ftlog:: builder ( )
17
+ . root (
18
+ FileAppender :: builder ( )
19
+ . path ( path)
20
+ . rotate ( Period :: Day )
21
+ . build ( ) ,
22
+ )
23
+ . try_init ( )
24
+ . unwrap ( ) ;
25
+
26
+ bencher. iter ( || info ! ( bench_log_message!( ) ) )
27
+ }
Original file line number Diff line number Diff line change
1
+ #![ feature( test) ]
2
+
3
+ extern crate test;
4
+
5
+ #[ path = "../common/mod.rs" ]
6
+ mod common;
7
+
8
+ use ftlog:: { appender:: FileAppender , LevelFilter } ;
9
+ use log:: info;
10
+ use test:: Bencher ;
11
+
12
+ #[ bench]
13
+ fn bench_5_level_off ( bencher : & mut Bencher ) {
14
+ let path = common:: BENCH_LOGS_PATH . join ( "level_off.log" ) ;
15
+
16
+ let _guard = ftlog:: builder ( )
17
+ . root ( FileAppender :: builder ( ) . path ( path) . build ( ) )
18
+ . max_log_level ( LevelFilter :: Off )
19
+ . try_init ( )
20
+ . unwrap ( ) ;
21
+
22
+ bencher. iter ( || info ! ( bench_log_message!( ) ) )
23
+ }
Original file line number Diff line number Diff line change
1
+ #![ feature( test) ]
2
+
3
+ extern crate test;
4
+
5
+ #[ path = "../common/mod.rs" ]
6
+ mod common;
7
+
8
+ aggregate_bench_main ! ( ) ;
You can’t perform that action at this time.
0 commit comments