MCPcopy Create free account
hub / github.com/apache/impala / Init

Method Init

be/src/util/simple-logger.cc:83–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81 max_log_files_(max_log_files) {}
82
83Status SimpleLogger::Init() {
84 // Check that Init hasn't already been called by verifying the log_file_name_ is still
85 // empty.
86 DCHECK(!initialized_);
87 DCHECK(log_file_name_.empty());
88 RETURN_IF_ERROR(InitLoggingDir(log_dir_));
89 log_file_name_ = GenerateLogFileName();
90 RETURN_IF_ERROR(FlushInternal());
91 LOG(INFO) << "Logging to: " << log_file_name_;
92 // There may be preexisting files from a previous incarnation of this logger. For
93 // example, if a service restarted and logged in the same locations. Proactively
94 // enforce the limit on the number of files to keep the semantics clear.
95 RotateLogFiles();
96 initialized_ = true;
97 return Status::OK();
98}
99
100Status SimpleLogger::AppendEntry(const std::string& entry) {
101 DCHECK(initialized_);

Callers

nothing calls this directly

Calls 3

InitLoggingDirFunction · 0.85
OKFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected