LoggerInterface inspired by PHP PSR-3
LoggerInterface.h
- Committer:
- Sille Van Landschoot
- Date:
- 2017-04-02
- Revision:
- 4:96f938f3d98a
- Parent:
- 1:8ee5fd3c1bf1
- Child:
- 6:015483427bd3
File content as of revision 4:96f938f3d98a:
#pragma once namespace Log{ class LoggerInterface { public: enum Level {EMERGENCY, ALERT, CRITICAL, ERROR, WARNING, NOTICE, INFO, DEBUG}; /** * System is unusable. * * @param string $message */ virtual void emergency(char* message, ...) = 0; /** * Action must be taken immediately. * * Example: Entire website down, database unavailable, etc. This should * trigger the SMS alerts and wake you up. * * @param string $message */ virtual void alert(char* message, ...) = 0; /** * Critical conditions. * * Example: Application component unavailable, unexpected exception. * * @param string $message */ virtual void critical(char* message, ...) = 0; /** * Runtime errors that do not require immediate action but should typically * be logged and monitored. * * @param string $message */ virtual void error(char* message, ...) = 0; /** * Exceptional occurrences that are not errors. * * Example: Use of deprecated APIs, poor use of an API, undesirable things * that are not necessarily wrong. * * @param string $message */ virtual void warning(char* message, ...) = 0; /** * Normal but significant events. * * @param string $message */ virtual void notice(char* message, ...) = 0; /** * Interesting events. * * Example: User logs in, SQL logs. * * @param string $message */ virtual void info(char* message, ...) = 0; /** * Detailed debug information. * * @param string $message */ virtual void debug(char* message, ...) = 0; /** * Logs with an arbitrary level. * * @param mixed $level * @param string $message */ virtual void log(Level level, char* message, ...) = 0; }; }