summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2014-07-14 16:33:02 -0700
committerKonstantin Käfer <mail@kkaefer.com>2014-07-14 16:33:02 -0700
commitbdc97d55d28dc07da944fdde065b9e00edd6d6c2 (patch)
tree4321776091bb8af5bc8742e19b7dcbe1364553ba /common
parent37bb2ff0484bbac6bc23bd4be40d5006f74ed7c0 (diff)
downloadqtlocation-mapboxgl-bdc97d55d28dc07da944fdde065b9e00edd6d6c2.tar.gz
add enum class to unify parsing/stringification
Diffstat (limited to 'common')
-rw-r--r--common/nslog_log.mm8
-rw-r--r--common/stderr_log.hpp8
2 files changed, 8 insertions, 8 deletions
diff --git a/common/nslog_log.mm b/common/nslog_log.mm
index 76f7ac42cf..c6ca65d0b7 100644
--- a/common/nslog_log.mm
+++ b/common/nslog_log.mm
@@ -7,7 +7,7 @@
namespace llmr {
void NSLogBackend::record(EventSeverity severity, Event event, const std::string &msg) {
- NSLog(@"[%s] %s: %@", stringifyEventSeverity(severity), stringifyEvent(event),
+ NSLog(@"[%s] %s: %@", EventSeverityClass(severity).c_str(), EventClass(event).c_str(),
[[NSString alloc] initWithBytes:msg.data()
length:msg.size()
encoding:NSUTF8StringEncoding]);
@@ -23,15 +23,15 @@ void NSLogBackend::record(EventSeverity severity, Event event, const char* forma
va_start(args, format);
vsnprintf(buffer.get(), len + 1, format, args);
va_end(args);
- NSLog(@"[%s] %s: %s", stringifyEventSeverity(severity), stringifyEvent(event), buffer.get());
+ NSLog(@"[%s] %s: %s", EventSeverityClass(severity).c_str(), EventClass(event).c_str(), buffer.get());
}
void NSLogBackend::record(EventSeverity severity, Event event, int64_t code) {
- NSLog(@"[%s] %s: (%lld)", stringifyEventSeverity(severity), stringifyEvent(event), code);
+ NSLog(@"[%s] %s: (%lld)", EventSeverityClass(severity).c_str(), EventClass(event).c_str(), code);
}
void NSLogBackend::record(EventSeverity severity, Event event, int64_t code, const std::string &msg) {
- NSLog(@"[%s] %s: (%lld) %@", stringifyEventSeverity(severity), stringifyEvent(event), code,
+ NSLog(@"[%s] %s: (%lld) %@", EventSeverityClass(severity).c_str(), EventClass(event).c_str(), code,
[[NSString alloc] initWithBytes:msg.data()
length:msg.size()
encoding:NSUTF8StringEncoding]);
diff --git a/common/stderr_log.hpp b/common/stderr_log.hpp
index e2492d3af5..43d1b41c2e 100644
--- a/common/stderr_log.hpp
+++ b/common/stderr_log.hpp
@@ -9,10 +9,10 @@ class StderrLogBackend : public LogBackend {
public:
inline ~StderrLogBackend() = default;
- void record(EventSeverity severity, Event event, const std::string &msg);
- void record(EventSeverity severity, Event event, const char* format, ...);
- void record(EventSeverity severity, Event event, int64_t code);
- void record(EventSeverity severity, Event event, int64_t code, const std::string &msg);
+ void record(EventSeverityClass severity, EventClass event, const std::string &msg);
+ void record(EventSeverityClass severity, EventClass event, const char* format, ...);
+ void record(EventSeverityClass severity, EventClass event, int64_t code);
+ void record(EventSeverityClass severity, EventClass event, int64_t code, const std::string &msg);
};