26 #include "lv_common.h"
32 #define LV_LOG_MAX_MESSAGE_SIZE 1024
51 static void output_to_stderr (
VisLogSeverity severity,
const char *msg,
73 visual_return_if_fail (is_valid_severity (severity));
75 handler = &log_handlers[severity];
81 const char *file,
int line,
const char *funcname,
87 char message[LV_LOG_MAX_MESSAGE_SIZE];
90 if (!is_valid_severity (severity) || fmt == NULL) {
95 if (verbosity > severity) {
100 vsnprintf (message, LV_LOG_MAX_MESSAGE_SIZE-1, fmt, va);
103 source.
file = visual_truncate_path (file, 3);
104 source.
func = funcname;
107 handler = &log_handlers[severity];
109 if (handler->func != NULL) {
110 handler->func (severity, message, &source, handler->priv);
112 output_to_stderr (severity, message, &source);
116 static void output_to_stderr (
VisLogSeverity severity,
const char *msg,
119 fprintf (stderr,
"%s %s:%d:%s: %s\n", log_prefixes[severity],