File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ void Trace::fillDefaultConfig(Json &cfg) const
3939{
4040 "enable": false,
4141 "max_size": 1024,
42- "enable_sync ": false
42+ "sync_enable ": false
4343}
4444)" _json;
4545}
@@ -52,24 +52,27 @@ bool Trace::initialize(Context &ctx, const Json &cfg)
5252 auto &js_trace = cfg.at (" trace" );
5353
5454 bool is_enable = false ;
55- bool is_enable_sync = false ;
55+ bool is_sync_enable = false ;
5656 std::string path_prefix;
5757 int max_size = 0 ;
5858
5959 util::json::GetField (js_trace, " path_prefix" , path_prefix);
6060 util::json::GetField (js_trace, " enable" , is_enable);
6161 util::json::GetField (js_trace, " max_size" , max_size);
62- util::json::GetField (js_trace, " enable_sync " , is_enable_sync );
62+ util::json::GetField (js_trace, " sync_enable " , is_sync_enable );
6363
6464 auto &sink = trace::Sink::GetInstance ();
6565
6666 if (max_size > 0 )
6767 sink.setRecordFileMaxSize (1024 * max_size);
6868
69- if (is_enable_sync )
69+ if (is_sync_enable )
7070 sink.setFileSyncEnable (true );
7171
72- if (sink.setPathPrefix (path_prefix) && is_enable)
72+ if (!path_prefix.empty ())
73+ sink.setPathPrefix (path_prefix);
74+
75+ if (is_enable)
7376 sink.enable ();
7477 }
7578 return true ;
You can’t perform that action at this time.
0 commit comments