Skip to content

Commit 53e724d

Browse files
committed
tidy(main)
1 parent 0388e95 commit 53e724d

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

modules/main/trace.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ void Trace::fillDefaultConfig(Json &cfg) const
3737
cfg["trace"] = R"(
3838
{
3939
"enable": false,
40-
"path_prefix": "/tmp/trace/unknown",
4140
"max_size": 1024,
4241
"enable_sync": false
4342
}
@@ -63,24 +62,21 @@ bool Trace::initialize(Context &ctx, const Json &cfg)
6362

6463
auto &sink = trace::Sink::GetInstance();
6564

66-
if (!path_prefix.empty()) {
67-
sink.setPathPrefix(path_prefix);
68-
if (is_enable)
69-
sink.enable();
70-
}
71-
7265
if (max_size > 0)
7366
sink.setRecordFileMaxSize(1024 * max_size);
7467

7568
if (is_enable_sync)
7669
sink.setFileSyncEnable(true);
70+
71+
if (sink.setPathPrefix(path_prefix) && is_enable)
72+
sink.enable();
7773
}
7874
return true;
7975
}
8076

8177
void Trace::initShell(TerminalNodes &term)
8278
{
83-
auto trace_node = term.createDirNode("This is log directory");
79+
auto trace_node = term.createDirNode("This is trace directory");
8480
term.mountNode(term.rootNode(), trace_node, "trace");
8581

8682
{

0 commit comments

Comments
 (0)