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

Function InitLoggingDir

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

Source from the content-addressed store, hash-verified

45const ptime EPOCH = time_from_string("1970-01-01 00:00:00.000");
46
47Status InitLoggingDir(const string& log_dir) {
48 if (!exists(log_dir)) {
49 LOG(INFO) << "Log directory does not exist, creating: " << log_dir;
50 try {
51 create_directories(log_dir);
52 } catch (const std::exception& e) { // Explicit std:: to distinguish from boost::
53 LOG(ERROR) << "Could not create log directory: "
54 << log_dir << ", " << e.what();
55 return Status("Failed to create log directory");
56 }
57 }
58
59 if (!is_directory(log_dir)) {
60 LOG(ERROR) << "Log path is not a directory ("
61 << log_dir << ")";
62 return Status("Log path is not a directory");
63 }
64 return Status::OK();
65}
66
67string SimpleLogger::GenerateLogFileName() {
68 stringstream ss;

Callers 1

InitMethod · 0.85

Calls 2

OKFunction · 0.85
StatusClass · 0.70

Tested by

no test coverage detected