Commit 97a5ea9ec847a95e250bc8e7cde0a5d4752da202

Authored by totoro
1 parent 6b53abab

made database query less verbose

database/db_utils.anubis
@@ -139,16 +139,17 @@ public define SQLite3QueryResult @@ -139,16 +139,17 @@ public define SQLite3QueryResult
139 String msg //message to be shown if an error occure 139 String msg //message to be shown if an error occure
140 ) = 140 ) =
141 //we try with 30 sec of timeout 141 //we try with 30 sec of timeout
  142 + //println(" executing [" + sql_query + "]");
142 with t0 = unow, 143 with t0 = unow,
143 if sql_query_timeout(db, sql_query, initial_bindings, 120, 100) is 144 if sql_query_timeout(db, sql_query, initial_bindings, 120, 100) is
144 { 145 {
145 error(sql_error) then logError("DB", db_error(sql_error,msg) /*+ " executing [" + sql_query + "]"*/); 146 error(sql_error) then logError("DB", db_error(sql_error,msg) /*+ " executing [" + sql_query + "]"*/);
146 //println(" executing [" + sql_query + "]"); 147 //println(" executing [" + sql_query + "]");
147 - __logQueries(t0, sql_query, msg); 148 + //__logQueries(t0, sql_query, msg);
148 __logLongQueries(t0, sql_query, msg); 149 __logLongQueries(t0, sql_query, msg);
149 error(sql_error), 150 error(sql_error),
150 ok(headers, cursor, reset) then 151 ok(headers, cursor, reset) then
151 - __logQueries(t0, sql_query, msg); 152 + //__logQueries(t0, sql_query, msg);
152 __logLongQueries(t0, sql_query, msg); 153 __logLongQueries(t0, sql_query, msg);
153 ok(headers, cursor, reset) 154 ok(headers, cursor, reset)
154 }. 155 }.
@@ -170,20 +171,21 @@ public define SQLite3Row @@ -170,20 +171,21 @@ public define SQLite3Row
170 String msg //message to be shown if an error occure 171 String msg //message to be shown if an error occure
171 ) = 172 ) =
172 //we try with 60 sec of timeout with 173 //we try with 60 sec of timeout with
  174 + //println(" executing [" + msg + "]");
173 with t0 = unow, 175 with t0 = unow,
174 if sql_query_statement_timeout(sql_command_stmt, initial_bindings, 120, 100, msg) is 176 if sql_query_statement_timeout(sql_command_stmt, initial_bindings, 120, 100, msg) is
175 { 177 {
176 error(sql_error) then logError("DB", db_error(sql_error,msg) /*+ " executing [" + sql_query + "]"*/); 178 error(sql_error) then logError("DB", db_error(sql_error,msg) /*+ " executing [" + sql_query + "]"*/);
177 - //println(" executing [" + sql_query + "]");  
178 - __logQueries(t0, "stmt", msg); 179 + //println(" executing [" + sql_command_stmt + "]");
  180 + //__logQueries(t0, "stmt", msg);
179 __logLongQueries(t0, "stmt", msg); 181 __logLongQueries(t0, "stmt", msg);
180 error(sql_error), 182 error(sql_error),
181 no_more_row then 183 no_more_row then
182 - __logQueries(t0, "stmt", msg); 184 + //__logQueries(t0, "stmt", msg);
183 __logLongQueries(t0, "stmt", msg); 185 __logLongQueries(t0, "stmt", msg);
184 no_more_row 186 no_more_row
185 row(data) then 187 row(data) then
186 - __logQueries(t0, "stmt", msg); 188 + //__logQueries(t0, "stmt", msg);
187 __logLongQueries(t0, "stmt", msg); 189 __logLongQueries(t0, "stmt", msg);
188 row(data) 190 row(data)
189 }. 191 }.
net_services_protocols/logger_service.anubis
@@ -68,21 +68,31 @@ define Bool @@ -68,21 +68,31 @@ define Bool
68 )= 68 )=
69 if find_string(msg, "LogString") is 69 if find_string(msg, "LogString") is
70 { 70 {
71 - failure then logError(log, "process_log can't find LogString");false, 71 + failure then
  72 + //println("process_log can't find LogString");
  73 + logError(log, "process_log can't find LogString");false,
  74 +
72 success(log_string) then 75 success(log_string) then
73 if find_int32(msg, "Level") is 76 if find_int32(msg, "Level") is
74 { 77 {
75 - failure then logError(log, "process_log can't find Level");false, 78 + failure then
  79 + //println("process_log can't find Level ["+log_string+"]");
  80 + logError(log, "process_log can't find Level");false,
76 success(int_level) then 81 success(int_level) then
77 if find_int32(msg, "Thread") is 82 if find_int32(msg, "Thread") is
78 { 83 {
79 - failure then logError(log, "process_log can't find Level");false, 84 + failure then
  85 + //println("process_log can't find Thread ["+log_string+"]");
  86 + logError(log, "process_log can't find Thread");false,
80 success(thread_id) then 87 success(thread_id) then
  88 + //println("*-*-> t["+thread_id+"] l["+int_level+"] s["+log_string+"]");
81 with level = get_LogLevel_from_value(to_Int(int_level)), 89 with level = get_LogLevel_from_value(to_Int(int_level)),
82 if level is logTrace then 90 if level is logTrace then
83 if find_string(msg, "LogMask") is 91 if find_string(msg, "LogMask") is
84 { 92 {
85 - failure then logError(log, "process_log can't find LogMask");false, 93 + failure then
  94 + //println("process_log can't find LogMask ["+log_string+"]");
  95 + logError(log, "process_log can't find LogMask");false,
86 success(log_mask) then logTrace(log, logMask(log_mask), log_string, thread_id); true 96 success(log_mask) then logTrace(log, logMask(log_mask), log_string, thread_id); true
87 } 97 }
88 else doLog(log, log_string, level, thread_id); true 98 else doLog(log, log_string, level, thread_id); true
@@ -198,9 +208,14 @@ define (UDP_Socket, ByteArray, Truncation, Word32, Word32) -> One @@ -198,9 +208,14 @@ define (UDP_Socket, ByteArray, Truncation, Word32, Word32) -> One
198 ) |-> 208 ) |->
199 with ip = ip_addr_to_string(ip_address), 209 with ip = ip_addr_to_string(ip_address),
200 logTrace(debug_logger, logMask("Logger"), "LoggerServer: data received (" + length(data) + " bytes) from IP " + ip + "... "); 210 logTrace(debug_logger, logMask("Logger"), "LoggerServer: data received (" + length(data) + " bytes) from IP " + ip + "... ");
  211 + //println("LoggerServer: data received (" + length(data) + " bytes) from IP " + ip + "... ");
  212 + //println("LoggerServer: data_preview " + data_preview(data, 20));
  213 +
201 if receive_message_from_io(make_data_io(data)) is 214 if receive_message_from_io(make_data_io(data)) is
202 { 215 {
203 - failure then logWarning(debug_logger, "LoggerServer: Bad data packet received from IP " + ip + ": " + data_preview(data, 20)), 216 + failure then
  217 + //println("LoggerServer: Bad data packet received from IP " + ip + ": " + data_preview(data, 20));
  218 + logWarning(debug_logger, "LoggerServer: Bad data packet received from IP " + ip + ": " + data_preview(data, 20)),
204 success(msg) then 219 success(msg) then
205 if *msg.what = _CXM_LOGGER_LOG then 220 if *msg.what = _CXM_LOGGER_LOG then
206 forget(process_log(logs, msg)) 221 forget(process_log(logs, msg))