blob: bcb84447bb2c9844c9a10302927ffb42ed8bc554 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
#include "stderr_log.hpp"
#include <iostream>
#include <cstdarg>
namespace mbgl {
void StderrLogBackend::record(EventSeverity severity, Event event, const std::string &msg) {
std::cerr << "[" << severity << "] " << event << ": " << msg << std::endl;
}
void StderrLogBackend::record(EventSeverity severity, Event event, const char* format, ...) {
std::cerr << "[" << severity << "] " << event << ": ";
va_list args;
va_start(args, format);
vfprintf(stderr, format, args);
va_end(args);
std::cerr << std::endl;
}
void StderrLogBackend::record(EventSeverity severity, Event event, int64_t code) {
std::cerr << "[" << severity << "] " << event << ": (" << code << ")" << std::endl;
}
void StderrLogBackend::record(EventSeverity severity, Event event, int64_t code, const std::string &msg) {
std::cerr << "[" << severity << "] " << event << ": (" << code << ") " << msg << std::endl;
}
}
|