blob: 8b0db05be791a0913a1f40d664e43606d46b1e17 (
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
31
32
33
|
// -*- mode: c++; c-basic-offset: 2; -*-
#ifndef LOGGER_HH
#define LOGGER_HH
#include <string>
class Logger {
public:
virtual ~Logger() {}
enum Level {
ERR,
WARN,
INFO
};
static Logger* create_stderr();
static Logger* create_syslog(std::string const& name);
static Logger* create_file(std::string const& path);
virtual void out(Level lvl, char const* format, ...)
#ifdef HAVE_FUNC_ATTRIBUTE_FORMAT
__attribute__ ((format (printf, 3, 4)))
#endif
= 0;
protected:
Logger() {}
Logger(Logger const&) = delete;
};
#endif // LOGGER_HH
|