summaryrefslogtreecommitdiff
path: root/lib/common
diff options
context:
space:
mode:
Diffstat (limited to 'lib/common')
-rw-r--r--lib/common/BoxTime.cpp9
-rw-r--r--lib/common/DebugPrintf.cpp6
-rw-r--r--lib/common/Logging.h14
3 files changed, 18 insertions, 11 deletions
diff --git a/lib/common/BoxTime.cpp b/lib/common/BoxTime.cpp
index eafb244f..1ddcffd4 100644
--- a/lib/common/BoxTime.cpp
+++ b/lib/common/BoxTime.cpp
@@ -12,12 +12,11 @@
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
+
#ifdef HAVE_TIME_H
#include <time.h>
#endif
-#ifdef HAVE_SYSLOG_H
- #include <syslog.h>
-#endif
+
#include <errno.h>
#include <string.h>
@@ -40,8 +39,8 @@ box_time_t GetCurrentBoxTime()
struct timeval tv;
if (gettimeofday(&tv, NULL) != 0)
{
- ::syslog(LOG_ERR, "gettimeofday() failed (%s), "
- "dropping precision", strerror(errno));
+ BOX_ERROR("Failed to gettimeofday(), dropping "
+ "precision: " << strerror(errno));
}
else
{
diff --git a/lib/common/DebugPrintf.cpp b/lib/common/DebugPrintf.cpp
index 8d75f458..14cd3534 100644
--- a/lib/common/DebugPrintf.cpp
+++ b/lib/common/DebugPrintf.cpp
@@ -14,12 +14,6 @@
#include <stdio.h>
#include <stdarg.h>
-#ifdef WIN32
- #include "emu.h"
-#else
- #include <syslog.h>
-#endif
-
#include "MemLeakFindOn.h"
// Use this apparently superflous printf function to avoid having to
diff --git a/lib/common/Logging.h b/lib/common/Logging.h
index aea488a5..e87d1d4f 100644
--- a/lib/common/Logging.h
+++ b/lib/common/Logging.h
@@ -10,6 +10,7 @@
#ifndef LOGGING__H
#define LOGGING__H
+#include <iomanip>
#include <sstream>
#include <vector>
@@ -42,6 +43,19 @@
#define BOX_TRACE(stuff) BOX_LOG(Log::TRACE, stuff)
#endif
+#define BOX_FORMAT_ACCOUNT(accno) \
+ std::hex << \
+ std::showbase << \
+ std::internal << \
+ std::setw(8) << \
+ std::setfill('0') << \
+ (accno)
+
+#define BOX_FORMAT_OBJECTID(objectid) \
+ std::hex << \
+ std::showbase << \
+ (objectid)
+
#undef ERROR
namespace Log