]> git.sesse.net Git - cubemap/blob - log.h
Replace map with unordered_map nearly everywhere, for speed.
[cubemap] / log.h
1 #ifndef _LOG_H
2 #define _LOG_H 1
3
4 // Functions for common logging to file and syslog.
5
6 #include <string>
7
8 enum LogLevel {
9         INFO,
10         WARNING,
11         ERROR,
12 };
13
14 void add_log_destination_file(const std::string &filename);
15 void add_log_destination_console();
16 void add_log_destination_syslog();
17
18 void start_logging();
19 void shut_down_logging();
20
21 void log(LogLevel log_level, const char *fmt, ...);
22 void log_perror(const char *msg);
23 void log_tls_error(const char *msg, int tls_err);
24
25 #endif  // !defined(_LOG_H)