libinvdb/source/include/logstream.hh

34 lines
520 B
C++

#ifndef INVENTORY_LOGSTREAM_HH_
#define INVENTORY_LOGSTREAM_HH_
#include <cstddef>
#include <string>
#include <iostream>
namespace inventory {
enum class Loglevel {
CRITICAL,
WARNING,
NOTICE,
INFO,
DEBUG,
DEBUG2
};
class Logstream {
public:
virtual void operator()(Loglevel lvl, const std::string &msg) = 0;
};
class StdLogstream : public Logstream {
public:
virtual void operator()(Loglevel lvl, const std::string &msg);
private:
static const char *sc_loglevel[];
};
}
#endif