Use Scopes for indented logging
masterLoguru supports indentation using scope macros. This is useful for visualizing nested logic or loops in your log files. When a scope is entered, subsequent log messages are indented; when the scope is exited, indentation is removed.
int main(int argc, char* argv[]) {
loguru::init(argc, argv);
LOG_SCOPE_FUNCTION(INFO);
LOG_F(INFO, "Doing some stuff...");
for (int i=0; i<2; ++i) {
VLOG_SCOPE_F(1, "Iteration %d", i);
// ... logic ...
}
return 0;
}