X-Git-Url: https://git.sesse.net/?p=cubemap;a=blobdiff_plain;f=log.cpp;h=198ceae9f64633031397fe5117deddb2b013404e;hp=417b544974d30754103bcb2640d0dce6c600f116;hb=061988af511f42da3cd584b4d983177504ddc177;hpb=16a03b9858752fae9e81af261821a2a22855fde3 diff --git a/log.cpp b/log.cpp index 417b544..198ceae 100644 --- a/log.cpp +++ b/log.cpp @@ -16,7 +16,7 @@ using namespace std; // Yes, it's a bit ugly. -#define SYSLOG_FAKE_FILE (static_cast(NULL)) +#define SYSLOG_FAKE_FILE (static_cast(nullptr)) bool logging_started = false; vector log_destinations; @@ -24,7 +24,7 @@ vector log_destinations; void add_log_destination_file(const string &filename) { FILE *fp = fopen(filename.c_str(), "a"); - if (fp == NULL) { + if (fp == nullptr) { perror(filename.c_str()); return; } @@ -71,11 +71,11 @@ void log(LogLevel log_level, const char *fmt, ...) vsnprintf(formatted_msg, sizeof(formatted_msg), fmt, ap); va_end(ap); - time_t now = time(NULL); + time_t now = time(nullptr); struct tm lt; struct tm *ltime = localtime_r(&now, <); char timestamp[1024]; - if (ltime == NULL) { + if (ltime == nullptr) { strcpy(timestamp, "???"); } else { strftime(timestamp, sizeof(timestamp), "%a, %d %b %Y %T %z", ltime);