24 #include <core/threading/mutex.h>
25 #include <logging/console.h>
27 #include <utils/system/console_colors.h>
51 now_s = (struct ::tm *)malloc(
sizeof(struct ::tm));
53 outf_ = fdopen(dup(STDERR_FILENO),
"a");
55 setvbuf(outf_, NULL, _IOLBF, 0);
71 gettimeofday(&now, NULL);
73 localtime_r(&now.tv_sec, now_s);
75 "%s%02d:%02d:%02d.%06ld %s: ",
82 vfprintf(outf_, format, va);
93 gettimeofday(&now, NULL);
95 localtime_r(&now.tv_sec, now_s);
97 "%02d:%02d:%02d.%06ld %s: ",
103 vfprintf(outf_, format, va);
104 fprintf(outf_,
"\n");
114 gettimeofday(&now, NULL);
116 localtime_r(&now.tv_sec, now_s);
118 "%s%02d:%02d:%02d.%06ld %s: ",
125 vfprintf(outf_, format, va);
136 gettimeofday(&now, NULL);
138 localtime_r(&now.tv_sec, now_s);
140 "%s%02d:%02d:%02d.%06ld %s: ",
147 vfprintf(outf_, format, va);
157 va_start(arg, format);
166 va_start(arg, format);
175 va_start(arg, format);
184 va_start(arg, format);
194 gettimeofday(&now, NULL);
196 localtime_r(&now.tv_sec, now_s);
199 "%s%02d:%02d:%02d.%06ld %s: [EXCEPTION] ",
206 fprintf(outf_,
"%s", *i);
218 gettimeofday(&now, NULL);
220 localtime_r(&now.tv_sec, now_s);
223 "%02d:%02d:%02d.%06ld %s: [EXCEPTION] ",
229 fprintf(outf_,
"%s", *i);
241 gettimeofday(&now, NULL);
243 localtime_r(&now.tv_sec, now_s);
246 "%s%02d:%02d:%02d.%06ld %s: [EXCEPTION] ",
253 fprintf(outf_,
"%s", *i);
265 gettimeofday(&now, NULL);
267 localtime_r(&now.tv_sec, now_s);
270 "%s%02d:%02d:%02d.%06ld %s: [EXCEPTION] ",
277 fprintf(outf_,
"%s", *i);
288 va_start(arg, format);
297 va_start(arg, format);
306 va_start(arg, format);
315 va_start(arg, format);
325 localtime_r(&t->tv_sec, now_s);
328 "%s%02d:%02d:%02d.%06ld %s: [EXCEPTION] ",
335 fprintf(outf_,
"%s", *i);
347 localtime_r(&t->tv_sec, now_s);
350 "%02d:%02d:%02d.%06ld %s: [EXCEPTION] ",
356 fprintf(outf_,
"%s", *i);
368 localtime_r(&t->tv_sec, now_s);
371 "%s%02d:%02d:%02d.%06ld %s: [EXCEPTION] ",
378 fprintf(outf_,
"%s", *i);
390 localtime_r(&t->tv_sec, now_s);
393 "%s%02d:%02d:%02d.%06ld %s: [EXCEPTION] ",
400 fprintf(outf_,
"%s", *i);
412 localtime_r(&t->tv_sec, now_s);
414 "%s%02d:%02d:%02d.%06ld %s: ",
421 vfprintf(outf_, format, va);
432 localtime_r(&t->tv_sec, now_s);
434 "%02d:%02d:%02d.%06ld %s: ",
440 vfprintf(outf_, format, va);
441 fprintf(outf_,
"\n");
451 localtime_r(&t->tv_sec, now_s);
453 "%s%02d:%02d:%02d.%06ld %s: ",
460 vfprintf(outf_, format, va);
471 localtime_r(&t->tv_sec, now_s);
473 "%s%02d:%02d:%02d.%06ld %s: ",
480 vfprintf(outf_, format, va);