Commit 6472541ff3bbd5e303a2135e15d0ac1e60712499
1 parent
3dd0561d
Logger service use logger to output its own error instead of println(), when logger is available.
Showing
1 changed file
with
6 additions
and
6 deletions
Show diff stats
calexium_lib/net_services_protocols/logger_service.anubis
| @@ -61,21 +61,21 @@ define Bool | @@ -61,21 +61,21 @@ define Bool | ||
| 61 | )= | 61 | )= |
| 62 | if find_string(msg, "LogString") is | 62 | if find_string(msg, "LogString") is |
| 63 | { | 63 | { |
| 64 | - failure then println("process_log can't find LogString");false, | 64 | + failure then logError(log, "process_log can't find LogString");false, |
| 65 | success(log_string) then | 65 | success(log_string) then |
| 66 | if find_int32(msg, "Level") is | 66 | if find_int32(msg, "Level") is |
| 67 | { | 67 | { |
| 68 | - failure then println("process_log can't find Level");false, | 68 | + failure then logError(log, "process_log can't find Level");false, |
| 69 | success(int_level) then | 69 | success(int_level) then |
| 70 | if find_int32(msg, "Thread") is | 70 | if find_int32(msg, "Thread") is |
| 71 | { | 71 | { |
| 72 | - failure then println("process_log can't find Level");false, | 72 | + failure then logError(log, "process_log can't find Level");false, |
| 73 | success(thread_id) then | 73 | success(thread_id) then |
| 74 | with level = get_LogLevel_from_value(int_level), | 74 | with level = get_LogLevel_from_value(int_level), |
| 75 | if level is logTrace then | 75 | if level is logTrace then |
| 76 | if find_string(msg, "LogMask") is | 76 | if find_string(msg, "LogMask") is |
| 77 | { | 77 | { |
| 78 | - failure then println("process_log can't find LogMask");false, | 78 | + failure then logError(log, "process_log can't find LogMask");false, |
| 79 | success(log_mask) then logTrace(log, logMask(log_mask), log_string, thread_id); true | 79 | success(log_mask) then logTrace(log, logMask(log_mask), log_string, thread_id); true |
| 80 | } | 80 | } |
| 81 | else doLog(log, log_string, level, thread_id); true | 81 | else doLog(log, log_string, level, thread_id); true |
| @@ -89,7 +89,7 @@ define Bool | @@ -89,7 +89,7 @@ define Bool | ||
| 89 | // logTrace then | 89 | // logTrace then |
| 90 | // if find_string(msg, "LogMask") is | 90 | // if find_string(msg, "LogMask") is |
| 91 | // { | 91 | // { |
| 92 | -// failure then println("process_log can't find LogMask");false, | 92 | +// failure then logError(log, "process_log can't find LogMask");false, |
| 93 | // success(log_mask) then logTrace(log, logMask(log_mask),log_string); true | 93 | // success(log_mask) then logTrace(log, logMask(log_mask),log_string); true |
| 94 | // } | 94 | // } |
| 95 | // } | 95 | // } |
| @@ -199,7 +199,7 @@ define (UDP_Socket, ByteArray, Truncation, Int32, Int32) -> One | @@ -199,7 +199,7 @@ define (UDP_Socket, ByteArray, Truncation, Int32, Int32) -> One | ||
| 199 | if *msg.what = _CXM_LOGGER_LOG then | 199 | if *msg.what = _CXM_LOGGER_LOG then |
| 200 | forget(process_log(logs, msg)) | 200 | forget(process_log(logs, msg)) |
| 201 | else | 201 | else |
| 202 | - println("wrong message_received is not _CXM_LOGGER_LOG ") | 202 | + println("LoggerService: wrong message_received. [" + to_hexa(*msg.what) + "] is not _CXM_LOGGER_LOG ") |
| 203 | }. | 203 | }. |
| 204 | 204 | ||
| 205 | define One | 205 | define One |