mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-22 01:20:39 +00:00
main: convert error messages to logger
Calling the logger 'main' may cause confusion to external readers not familiar with the source code, since there is nothing 'main' about this logger in particular - that is just the file name. It is then called the start up log. Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
This commit is contained in:
committed by
Avi Kivity
parent
66d6e471ad
commit
746fdc87b9
7
main.cc
7
main.cc
@@ -50,6 +50,9 @@ static void apply_logger_settings(sstring default_level, db::config::string_map
|
||||
logging::logger::set_syslog_enabled(log_to_syslog);
|
||||
}
|
||||
|
||||
|
||||
logging::logger startlog("start up");
|
||||
|
||||
int main(int ac, char** av) {
|
||||
runtime::init_uptime();
|
||||
std::setvbuf(stdout, nullptr, _IOLBF, 1000);
|
||||
@@ -121,7 +124,7 @@ int main(int ac, char** av) {
|
||||
try {
|
||||
f.get();
|
||||
} catch (std::system_error& e) {
|
||||
fprint(std::cerr, "Directory \"%s\" not found. Tried to created it but failed: %s\n", datadir, e.what());
|
||||
startlog.error("Directory '{}' not found. Tried to created it but failed: {}", datadir, e.what());
|
||||
throw;
|
||||
}
|
||||
});
|
||||
@@ -132,7 +135,7 @@ int main(int ac, char** av) {
|
||||
try {
|
||||
f.get();
|
||||
} catch (std::system_error& e) {
|
||||
fprint(std::cerr, "commitlog directory \"%s\" not found. Tried to created it but failed: %s\n", commitlog, e.what());
|
||||
startlog.error("commitlog directory '{}' not found. Tried to created it but failed: {}", commitlog, e.what());
|
||||
throw;
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user