if (FLAGS_timestamp_in_logfile_name) { string_filename += time_pid_string; } const char* filename = string_filename.c_str(); int fd = open(filename, O_WRONLY | O_CREAT | O_EXCL, FLAGS_logfile_mode); //only write to files, create if non-...
| ^~~~ /usr/include/glog/flags.h:115:1: error: ‘FLAGS_timestamp_in_logfile_name’ has not been declared in ‘fLB’ 115 | DECLARE_bool(timestamp_in_logfile_name); | ^~~~ /usr/include/glog/flags.h:118:1: error: ‘GLOG_EXPORT’ does not name a type; did you mean ‘FOLLY_EX...
//构造函数LogMessage::LogMessage(constchar*file,intline):allocated_(NULL){Init(file,line,GLOG_INFO,&LogMessage::SendToLog);}//初始化voidLogMessage::Init(constchar*file,intline,LogSeverityseverity,void(LogMessage::*send_method)()){...if(FLAGS_log_prefix&&...
// by the date, time, and pid (you can't prevent the date, time, and pid // from being in the filename). // // The logging code takes two flags: // --v=# set the verbose level // --logtostderr log all the messages to stderr instead of to logfiles // LOG LINE...
(now-data_->timestamp_)*1000000);data_->num_chars_to_log_=0;data_->num_chars_to_syslog_=0;data_->basename_=const_basename(file);data_->fullname_=file;data_->has_been_flushed_=false;// 5. 日志每行都输出一个前缀// If specified, prepend a prefix to each line. For example://...
time_t timestamp, const char* message, int message_len) = 0; // Flush any buffered messages virtual void Flush() = 0; // Get the current LOG file size. // The returned value is approximate since some // logged data may not have been flushed to disk yet. ...
static void SetLogFilenameExtension(const char* filename_extension); static void SetStderrLogging(LogSeverity min_severity); static void SetEmailLogging(LogSeverity min_severity, const char* addresses); static void LogToStderr(); static void FlushLogFiles(int min_severity); ...
inline void LogDestination::MaybeLogToLogfile(LogSeverity severity, time_t timestamp, const char* message, size_t len) { const bool should_flush = severity > FLAGS_logbuflevel; // 这里每个log level都会有一个LogDestination的对象指针 LogDestination* destination = log_destination(severity); // ...
LogDestination::MaybeLogToLogfile函数精简: inline void LogDestination::MaybeLogToLogfile(LogSeverity severity, time_t timestamp, const char* message, size_t len) { const bool should_flush = severity > FLAGS_logbuflevel; // 这里每个log level都会有一个LogDestination的对象指针 ...
int64 next_flush_time_; // cycle count at which to flush log string hostname; bool stopWriting; std::unique_ptr<Active> m_pActive; bool CreateLogfile(const string& time_pid_string); void FlushUnlocked(); void WriteInteral(bool force_flush, time_t timestamp, const char* message, int ...