X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=log.cpp;h=198ceae9f64633031397fe5117deddb2b013404e;hb=a0fe013448d188b324c00383cfd91695d9d3d076;hp=417b544974d30754103bcb2640d0dce6c600f116;hpb=26fe3ab755034ea3be8321ec0af548670f8c3bd8;p=cubemap 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);