Commit 6472541ff3bbd5e303a2135e15d0ac1e60712499

Authored by Cédric RICARD
1 parent 3dd0561d

Logger service use logger to output its own error instead of println(), when logger is available.

calexium_lib/net_services_protocols/logger_service.anubis
... ... @@ -61,21 +61,21 @@ define Bool
61 61 )=
62 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 65 success(log_string) then
66 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 69 success(int_level) then
70 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 73 success(thread_id) then
74 74 with level = get_LogLevel_from_value(int_level),
75 75 if level is logTrace then
76 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 79 success(log_mask) then logTrace(log, logMask(log_mask), log_string, thread_id); true
80 80 }
81 81 else doLog(log, log_string, level, thread_id); true
... ... @@ -89,7 +89,7 @@ define Bool
89 89 // logTrace then
90 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 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 199 if *msg.what = _CXM_LOGGER_LOG then
200 200 forget(process_log(logs, msg))
201 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 205 define One
... ...