LoggerInterface inspired by PHP PSR-3
Fork of LoggerInterface by
Diff: LoggerInterface.h
- Revision:
- 1:8ee5fd3c1bf1
- Parent:
- 0:13d1767f0c98
- Child:
- 2:97f331aa4938
--- a/LoggerInterface.h Thu Nov 24 13:16:44 2016 +0000 +++ b/LoggerInterface.h Thu Nov 24 14:25:31 2016 +0000 @@ -1,17 +1,18 @@ -#include <stdarg.h> - -namespace Log; +namespace Log{ class LoggerInterface { public: + + enum Level {EMERGENCY, ALERT, CRITICAL, ERROR, WARNING, NOTICE, INFO, DEBUG}; + /** * System is unusable. * * @param string $message */ - void emergency(char* message, ...) = null; + virtual void emergency(char* message, ...) = 0; /** * Action must be taken immediately. @@ -21,7 +22,7 @@ * * @param string $message */ - void alert(char* message, ...) = null; + virtual void alert(char* message, ...) = 0; /** * Critical conditions. @@ -30,7 +31,7 @@ * * @param string $message */ - void critical(char* message, ...) = null; + virtual void critical(char* message, ...) = 0; /** * Runtime errors that do not require immediate action but should typically @@ -38,7 +39,7 @@ * * @param string $message */ - void error(char* message, ...) = null; + virtual void error(char* message, ...) = 0; /** * Exceptional occurrences that are not errors. @@ -48,14 +49,14 @@ * * @param string $message */ - void warning(char* message, ...) = null; + virtual void warning(char* message, ...) = 0; /** * Normal but significant events. * * @param string $message */ - void notice(char* message, ...) = null; + virtual void notice(char* message, ...) = 0; /** * Interesting events. @@ -64,14 +65,14 @@ * * @param string $message */ - void info(char* message, ...) = null; + virtual void info(char* message, ...) = 0; /** * Detailed debug information. * * @param string $message */ - void debug(char* message, ...) = null; + virtual void debug(char* message, ...) = 0; /** * Logs with an arbitrary level. @@ -79,5 +80,7 @@ * @param mixed $level * @param string $message */ - void log(Level level, char* message, ...) = null; + virtual void log(Level level, char* message, ...) = 0; +}; + } \ No newline at end of file