Skip to content

Commit

Permalink
Make "-B all" apply to plugin streams as well.
Browse files Browse the repository at this point in the history
  • Loading branch information
ckreibich committed Nov 15, 2024
1 parent 5e4942b commit f56ab49
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/DebugLogger.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ DebugLogger::Stream DebugLogger::streams[NUM_DBGS] =
{"scripts", 0, false}, {"supervisor", 0, false}, {"hashkey", 0, false}, {"spicy", 0, false}};

DebugLogger::DebugLogger() {
verbose = false;
file = nullptr;
verbose = false;
all = false;
}

DebugLogger::~DebugLogger() {
Expand Down Expand Up @@ -94,6 +95,7 @@ void DebugLogger::EnableStreams(const char* s) {
enabled_streams.insert(streams[i].prefix);
}

all = true;
verbose = true;
goto next;
}
Expand Down Expand Up @@ -175,10 +177,11 @@ void DebugLogger::Log(DebugStream stream, const char* fmt, ...) {
}

void DebugLogger::Log(const plugin::Plugin& plugin, const char* fmt, ...) {
std::string tok = PluginStreamName(plugin.Name());

if ( enabled_streams.find(tok) == enabled_streams.end() )
return;
if ( ! all ) {
std::string tok = PluginStreamName(plugin.Name());
if ( enabled_streams.find(tok) == enabled_streams.end() )
return;
}

fprintf(file, "%17.06f/%17.06f [plugin %s] ", run_state::network_time, util::current_time(true),
plugin.Name().c_str());
Expand Down
1 change: 1 addition & 0 deletions src/DebugLogger.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ class DebugLogger {

private:
FILE* file;
bool all;
bool verbose;

struct Stream {
Expand Down

0 comments on commit f56ab49

Please sign in to comment.