| 1 | #pragma once
|
|---|
| 2 |
|
|---|
| 3 | #include "core_api.h"
|
|---|
| 4 | #include <settings/Settings.h>
|
|---|
| 5 |
|
|---|
| 6 | class settings_logger : public Settings::LoggerInterface {
|
|---|
| 7 | public:
|
|---|
| 8 | //////////////////////////////////////////////////////////////////////////
|
|---|
| 9 | /// Log an ERROR message.
|
|---|
| 10 | ///
|
|---|
| 11 | /// @param file the file where the event happened
|
|---|
| 12 | /// @param line the line where the event happened
|
|---|
| 13 | /// @param message the message to log
|
|---|
| 14 | ///
|
|---|
| 15 | /// @author mickem
|
|---|
| 16 | void err(std::wstring file, int line, std::wstring message) {
|
|---|
| 17 | NSAPIMessage(NSCAPI::error, file.c_str(), line, message.c_str());
|
|---|
| 18 | }
|
|---|
| 19 | //////////////////////////////////////////////////////////////////////////
|
|---|
| 20 | /// Log an WARNING message.
|
|---|
| 21 | ///
|
|---|
| 22 | /// @param file the file where the event happened
|
|---|
| 23 | /// @param line the line where the event happened
|
|---|
| 24 | /// @param message the message to log
|
|---|
| 25 | ///
|
|---|
| 26 | /// @author mickem
|
|---|
| 27 | void warn(std::wstring file, int line, std::wstring message) {
|
|---|
| 28 | NSAPIMessage(NSCAPI::warning, file.c_str(), line, message.c_str());
|
|---|
| 29 | }
|
|---|
| 30 | //////////////////////////////////////////////////////////////////////////
|
|---|
| 31 | /// Log an INFO message.
|
|---|
| 32 | ///
|
|---|
| 33 | /// @param file the file where the event happened
|
|---|
| 34 | /// @param line the line where the event happened
|
|---|
| 35 | /// @param message the message to log
|
|---|
| 36 | ///
|
|---|
| 37 | /// @author mickem
|
|---|
| 38 | void info(std::wstring file, int line, std::wstring message) {
|
|---|
| 39 | NSAPIMessage(NSCAPI::log, file.c_str(), line, message.c_str());
|
|---|
| 40 | }
|
|---|
| 41 | //////////////////////////////////////////////////////////////////////////
|
|---|
| 42 | /// Log an DEBUG message.
|
|---|
| 43 | ///
|
|---|
| 44 | /// @param file the file where the event happened
|
|---|
| 45 | /// @param line the line where the event happened
|
|---|
| 46 | /// @param message the message to log
|
|---|
| 47 | ///
|
|---|
| 48 | /// @author mickem
|
|---|
| 49 | void debug(std::wstring file, int line, std::wstring message) {
|
|---|
| 50 | NSAPIMessage(NSCAPI::debug, file.c_str(), line, message.c_str());
|
|---|
| 51 | }
|
|---|
| 52 | };
|
|---|