MCPcopy Create free account
hub / github.com/apache/singa / GenerateLogMessage

Method GenerateLogMessage

src/utils/logging.cc:84–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82inline pid_t GetTID() { return (pid_t)(uintptr_t)pthread_self(); }
83
84void LogMessage::GenerateLogMessage() {
85 time_t rw_time = time(nullptr);
86 struct tm tm_time;
87 localtime_r(&rw_time, &tm_time);
88 // log to a file
89 for (int i = severity_; i >= 0; --i)
90 if (log_file[i]) DoLogging(log_file[i], tm_time);
91 // log to stderr
92 if (!not_log_stderr[severity_]) DoLogging(stderr, tm_time);
93}
94
95void LogMessage::DoLogging(FILE* file, const struct tm& tm_time) {
96 fprintf(file, "[%c d%02d%02d t%02d:%02d:%02d p%05d:%03d %s:%d] %s\n",

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected