LoggerInterface inspired by PHP PSR-3

Dependents:   LogIt

Committer:
sillevl
Date:
Thu Nov 24 13:16:44 2016 +0000
Revision:
0:13d1767f0c98
Child:
1:8ee5fd3c1bf1
LoggerInterface inspired by PHP PSR-3

Who changed what in which revision?

UserRevisionLine numberNew contents of line
sillevl 0:13d1767f0c98 1
sillevl 0:13d1767f0c98 2 #include <stdarg.h>
sillevl 0:13d1767f0c98 3
sillevl 0:13d1767f0c98 4 namespace Log;
sillevl 0:13d1767f0c98 5
sillevl 0:13d1767f0c98 6 class LoggerInterface
sillevl 0:13d1767f0c98 7 {
sillevl 0:13d1767f0c98 8 public:
sillevl 0:13d1767f0c98 9 /**
sillevl 0:13d1767f0c98 10 * System is unusable.
sillevl 0:13d1767f0c98 11 *
sillevl 0:13d1767f0c98 12 * @param string $message
sillevl 0:13d1767f0c98 13 */
sillevl 0:13d1767f0c98 14 void emergency(char* message, ...) = null;
sillevl 0:13d1767f0c98 15
sillevl 0:13d1767f0c98 16 /**
sillevl 0:13d1767f0c98 17 * Action must be taken immediately.
sillevl 0:13d1767f0c98 18 *
sillevl 0:13d1767f0c98 19 * Example: Entire website down, database unavailable, etc. This should
sillevl 0:13d1767f0c98 20 * trigger the SMS alerts and wake you up.
sillevl 0:13d1767f0c98 21 *
sillevl 0:13d1767f0c98 22 * @param string $message
sillevl 0:13d1767f0c98 23 */
sillevl 0:13d1767f0c98 24 void alert(char* message, ...) = null;
sillevl 0:13d1767f0c98 25
sillevl 0:13d1767f0c98 26 /**
sillevl 0:13d1767f0c98 27 * Critical conditions.
sillevl 0:13d1767f0c98 28 *
sillevl 0:13d1767f0c98 29 * Example: Application component unavailable, unexpected exception.
sillevl 0:13d1767f0c98 30 *
sillevl 0:13d1767f0c98 31 * @param string $message
sillevl 0:13d1767f0c98 32 */
sillevl 0:13d1767f0c98 33 void critical(char* message, ...) = null;
sillevl 0:13d1767f0c98 34
sillevl 0:13d1767f0c98 35 /**
sillevl 0:13d1767f0c98 36 * Runtime errors that do not require immediate action but should typically
sillevl 0:13d1767f0c98 37 * be logged and monitored.
sillevl 0:13d1767f0c98 38 *
sillevl 0:13d1767f0c98 39 * @param string $message
sillevl 0:13d1767f0c98 40 */
sillevl 0:13d1767f0c98 41 void error(char* message, ...) = null;
sillevl 0:13d1767f0c98 42
sillevl 0:13d1767f0c98 43 /**
sillevl 0:13d1767f0c98 44 * Exceptional occurrences that are not errors.
sillevl 0:13d1767f0c98 45 *
sillevl 0:13d1767f0c98 46 * Example: Use of deprecated APIs, poor use of an API, undesirable things
sillevl 0:13d1767f0c98 47 * that are not necessarily wrong.
sillevl 0:13d1767f0c98 48 *
sillevl 0:13d1767f0c98 49 * @param string $message
sillevl 0:13d1767f0c98 50 */
sillevl 0:13d1767f0c98 51 void warning(char* message, ...) = null;
sillevl 0:13d1767f0c98 52
sillevl 0:13d1767f0c98 53 /**
sillevl 0:13d1767f0c98 54 * Normal but significant events.
sillevl 0:13d1767f0c98 55 *
sillevl 0:13d1767f0c98 56 * @param string $message
sillevl 0:13d1767f0c98 57 */
sillevl 0:13d1767f0c98 58 void notice(char* message, ...) = null;
sillevl 0:13d1767f0c98 59
sillevl 0:13d1767f0c98 60 /**
sillevl 0:13d1767f0c98 61 * Interesting events.
sillevl 0:13d1767f0c98 62 *
sillevl 0:13d1767f0c98 63 * Example: User logs in, SQL logs.
sillevl 0:13d1767f0c98 64 *
sillevl 0:13d1767f0c98 65 * @param string $message
sillevl 0:13d1767f0c98 66 */
sillevl 0:13d1767f0c98 67 void info(char* message, ...) = null;
sillevl 0:13d1767f0c98 68
sillevl 0:13d1767f0c98 69 /**
sillevl 0:13d1767f0c98 70 * Detailed debug information.
sillevl 0:13d1767f0c98 71 *
sillevl 0:13d1767f0c98 72 * @param string $message
sillevl 0:13d1767f0c98 73 */
sillevl 0:13d1767f0c98 74 void debug(char* message, ...) = null;
sillevl 0:13d1767f0c98 75
sillevl 0:13d1767f0c98 76 /**
sillevl 0:13d1767f0c98 77 * Logs with an arbitrary level.
sillevl 0:13d1767f0c98 78 *
sillevl 0:13d1767f0c98 79 * @param mixed $level
sillevl 0:13d1767f0c98 80 * @param string $message
sillevl 0:13d1767f0c98 81 */
sillevl 0:13d1767f0c98 82 void log(Level level, char* message, ...) = null;
sillevl 0:13d1767f0c98 83 }