#ifndef logger_h #define logger_h #include #include #include #include #include namespace eir { class Bot; class Client; class LogDestination { public: virtual void Log(Bot *, Client *, std::string) = 0; virtual ~LogDestination() { } }; class LogBackend { public: virtual LogDestination* create_destination(std::string) = 0; virtual ~LogBackend() { } }; class Logger : public paludis::PrivateImplementationPattern, public paludis::InstantiationPolicy { public: enum { Debug = 0x01, Command = 0x02, Info = 0x04, Privs = 0x08, Warning = 0x10, Raw = 0x20, Admin = 0x40, All = 0xffffffff }; typedef unsigned int Type; void Log(Bot *, Client *, Type, std::string); void Log(Bot *, std::shared_ptr, Type, std::string); typedef unsigned int BackendId; BackendId register_backend(std::string, LogBackend *); void unregister_backend(BackendId); typedef unsigned int DestinationId; DestinationId add_destination(std::string type, std::string arg, Type types); void remove_destination(DestinationId); void clear_logs(); Logger(); ~Logger(); }; } #endif