We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use the following snippet:
void custom_formatter(std::ostream& s, const google::LogMessage& m, void* data) { s << google::GetLogSeverityName(m.severity())[0] << "[" << std::setw(2) << m.time().hour() << ':' << std::setw(2) << m.time().min() << ':' << std::setw(2) << m.time().sec() << "." << ' ' << std::setfill(' ') << std::setw(5) << ' ' << m.basename() << ':' << m.line() << "]"; } int main(int argc, char** argv) { google::InitGoogleLogging(argv[0]); google::InstallPrefixFormatter(&custom_formatter); auto num_cookies = 15; LOG(INFO) << "Found " << num_cookies << " cookies"; return 0; }
Gives the following output:
Log file created at: 2024/11/07 16:12:06 Running on machine: AAAAAAAAAAA Running duration (h:mm:ss): 0:00:00 Log line format: [IWEF]yyyymmdd hh:mm:ss.uuuuuu threadid file:line] msg I[16:12:06. glog_functions.cpp:72] Found 15 cookies
I would expect the threadid would not appear in the log line format
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Use the following snippet:
Gives the following output:
I would expect the threadid would not appear in the log line format
The text was updated successfully, but these errors were encountered: