Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of LoggerInterface by
LoggerInterface.h@3:8b20cda3dee5, 2016-12-14 (annotated)
- Committer:
- Nico De Witte
- Date:
- Wed Dec 14 17:57:03 2016 +0100
- Revision:
- 3:8b20cda3dee5
- Parent:
- 2:97f331aa4938
Change message from char * to const char * as it should. Also removing a lot of compiler warnings like this.
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| dwini | 2:97f331aa4938 | 1 | #pragma once |
| sillevl | 0:13d1767f0c98 | 2 | |
| sillevl | 1:8ee5fd3c1bf1 | 3 | namespace Log{ |
| sillevl | 0:13d1767f0c98 | 4 | |
| sillevl | 0:13d1767f0c98 | 5 | class LoggerInterface |
| sillevl | 0:13d1767f0c98 | 6 | { |
| sillevl | 0:13d1767f0c98 | 7 | public: |
| Nico De Witte |
3:8b20cda3dee5 | 8 | |
| sillevl | 1:8ee5fd3c1bf1 | 9 | enum Level {EMERGENCY, ALERT, CRITICAL, ERROR, WARNING, NOTICE, INFO, DEBUG}; |
| Nico De Witte |
3:8b20cda3dee5 | 10 | |
| sillevl | 0:13d1767f0c98 | 11 | /** |
| sillevl | 0:13d1767f0c98 | 12 | * System is unusable. |
| sillevl | 0:13d1767f0c98 | 13 | * |
| sillevl | 0:13d1767f0c98 | 14 | * @param string $message |
| sillevl | 0:13d1767f0c98 | 15 | */ |
| Nico De Witte |
3:8b20cda3dee5 | 16 | virtual void emergency(const char * message, ...) = 0; |
| sillevl | 0:13d1767f0c98 | 17 | |
| sillevl | 0:13d1767f0c98 | 18 | /** |
| sillevl | 0:13d1767f0c98 | 19 | * Action must be taken immediately. |
| sillevl | 0:13d1767f0c98 | 20 | * |
| sillevl | 0:13d1767f0c98 | 21 | * Example: Entire website down, database unavailable, etc. This should |
| sillevl | 0:13d1767f0c98 | 22 | * trigger the SMS alerts and wake you up. |
| sillevl | 0:13d1767f0c98 | 23 | * |
| sillevl | 0:13d1767f0c98 | 24 | * @param string $message |
| sillevl | 0:13d1767f0c98 | 25 | */ |
| Nico De Witte |
3:8b20cda3dee5 | 26 | virtual void alert(const char * message, ...) = 0; |
| sillevl | 0:13d1767f0c98 | 27 | |
| sillevl | 0:13d1767f0c98 | 28 | /** |
| sillevl | 0:13d1767f0c98 | 29 | * Critical conditions. |
| sillevl | 0:13d1767f0c98 | 30 | * |
| sillevl | 0:13d1767f0c98 | 31 | * Example: Application component unavailable, unexpected exception. |
| sillevl | 0:13d1767f0c98 | 32 | * |
| sillevl | 0:13d1767f0c98 | 33 | * @param string $message |
| sillevl | 0:13d1767f0c98 | 34 | */ |
| Nico De Witte |
3:8b20cda3dee5 | 35 | virtual void critical(const char * message, ...) = 0; |
| sillevl | 0:13d1767f0c98 | 36 | |
| sillevl | 0:13d1767f0c98 | 37 | /** |
| sillevl | 0:13d1767f0c98 | 38 | * Runtime errors that do not require immediate action but should typically |
| sillevl | 0:13d1767f0c98 | 39 | * be logged and monitored. |
| sillevl | 0:13d1767f0c98 | 40 | * |
| sillevl | 0:13d1767f0c98 | 41 | * @param string $message |
| sillevl | 0:13d1767f0c98 | 42 | */ |
| Nico De Witte |
3:8b20cda3dee5 | 43 | virtual void error(const char * message, ...) = 0; |
| sillevl | 0:13d1767f0c98 | 44 | |
| sillevl | 0:13d1767f0c98 | 45 | /** |
| sillevl | 0:13d1767f0c98 | 46 | * Exceptional occurrences that are not errors. |
| sillevl | 0:13d1767f0c98 | 47 | * |
| sillevl | 0:13d1767f0c98 | 48 | * Example: Use of deprecated APIs, poor use of an API, undesirable things |
| sillevl | 0:13d1767f0c98 | 49 | * that are not necessarily wrong. |
| sillevl | 0:13d1767f0c98 | 50 | * |
| sillevl | 0:13d1767f0c98 | 51 | * @param string $message |
| sillevl | 0:13d1767f0c98 | 52 | */ |
| Nico De Witte |
3:8b20cda3dee5 | 53 | virtual void warning(const char * message, ...) = 0; |
| sillevl | 0:13d1767f0c98 | 54 | |
| sillevl | 0:13d1767f0c98 | 55 | /** |
| sillevl | 0:13d1767f0c98 | 56 | * Normal but significant events. |
| sillevl | 0:13d1767f0c98 | 57 | * |
| sillevl | 0:13d1767f0c98 | 58 | * @param string $message |
| sillevl | 0:13d1767f0c98 | 59 | */ |
| Nico De Witte |
3:8b20cda3dee5 | 60 | virtual void notice(const char * message, ...) = 0; |
| sillevl | 0:13d1767f0c98 | 61 | |
| sillevl | 0:13d1767f0c98 | 62 | /** |
| sillevl | 0:13d1767f0c98 | 63 | * Interesting events. |
| sillevl | 0:13d1767f0c98 | 64 | * |
| sillevl | 0:13d1767f0c98 | 65 | * Example: User logs in, SQL logs. |
| sillevl | 0:13d1767f0c98 | 66 | * |
| sillevl | 0:13d1767f0c98 | 67 | * @param string $message |
| sillevl | 0:13d1767f0c98 | 68 | */ |
| Nico De Witte |
3:8b20cda3dee5 | 69 | virtual void info(const char * message, ...) = 0; |
| sillevl | 0:13d1767f0c98 | 70 | |
| sillevl | 0:13d1767f0c98 | 71 | /** |
| sillevl | 0:13d1767f0c98 | 72 | * Detailed debug information. |
| sillevl | 0:13d1767f0c98 | 73 | * |
| sillevl | 0:13d1767f0c98 | 74 | * @param string $message |
| sillevl | 0:13d1767f0c98 | 75 | */ |
| Nico De Witte |
3:8b20cda3dee5 | 76 | virtual void debug(const char * message, ...) = 0; |
| sillevl | 0:13d1767f0c98 | 77 | |
| sillevl | 0:13d1767f0c98 | 78 | /** |
| sillevl | 0:13d1767f0c98 | 79 | * Logs with an arbitrary level. |
| sillevl | 0:13d1767f0c98 | 80 | * |
| sillevl | 0:13d1767f0c98 | 81 | * @param mixed $level |
| sillevl | 0:13d1767f0c98 | 82 | * @param string $message |
| sillevl | 0:13d1767f0c98 | 83 | */ |
| Nico De Witte |
3:8b20cda3dee5 | 84 | virtual void log(Level level, const char * message, ...) = 0; |
| sillevl | 1:8ee5fd3c1bf1 | 85 | }; |
| sillevl | 1:8ee5fd3c1bf1 | 86 | |
| Nico De Witte |
3:8b20cda3dee5 | 87 | } |
