diff --git a/auto_tests/auto_test_support.c b/auto_tests/auto_test_support.c index 213e70570c..483e3130b7 100644 --- a/auto_tests/auto_test_support.c +++ b/auto_tests/auto_test_support.c @@ -444,9 +444,9 @@ void print_debug_log(Tox *m, Tox_Log_Level level, const char *file, uint32_t lin } } -void print_debug_logger(void *context, Logger_Level level, const char *file, int line, const char *func, const char *message, void *userdata) +void print_debug_logger(void *context, Logger_Level level, const char *file, uint32_t line, const char *func, const char *message, void *userdata) { - print_debug_log(nullptr, (Tox_Log_Level) level, file, (uint32_t) line, func, message, userdata); + print_debug_log(nullptr, (Tox_Log_Level) level, file, line, func, message, userdata); } Tox *tox_new_log_lan(struct Tox_Options *options, Tox_Err_New *err, void *log_user_data, bool lan_discovery) diff --git a/auto_tests/auto_test_support.h b/auto_tests/auto_test_support.h index b9132e16bc..cd883e28c9 100644 --- a/auto_tests/auto_test_support.h +++ b/auto_tests/auto_test_support.h @@ -60,7 +60,7 @@ void print_debug_log(Tox *m, Tox_Log_Level level, const char *file, uint32_t lin const char *message, void *user_data); // Use this function when setting the log callback on a Logger object -void print_debug_logger(void *context, Logger_Level level, const char *file, int line, +void print_debug_logger(void *context, Logger_Level level, const char *file, uint32_t line, const char *func, const char *message, void *userdata); Tox *tox_new_log(struct Tox_Options *options, Tox_Err_New *err, void *log_user_data); diff --git a/other/DHT_bootstrap.c b/other/DHT_bootstrap.c index c4511aa1f2..4f06c79f5e 100644 --- a/other/DHT_bootstrap.c +++ b/other/DHT_bootstrap.c @@ -117,7 +117,7 @@ static const char *strlevel(Logger_Level level) } } -static void print_log(void *context, Logger_Level level, const char *file, int line, +static void print_log(void *context, Logger_Level level, const char *file, uint32_t line, const char *func, const char *message, void *userdata) { fprintf(stderr, "[%s] %s:%d(%s) %s\n", strlevel(level), file, line, func, message); diff --git a/other/bootstrap_daemon/src/tox-bootstrapd.c b/other/bootstrap_daemon/src/tox-bootstrapd.c index e29afe5c2b..44aeecee3d 100644 --- a/other/bootstrap_daemon/src/tox-bootstrapd.c +++ b/other/bootstrap_daemon/src/tox-bootstrapd.c @@ -200,10 +200,10 @@ static LOG_LEVEL logger_level_to_log_level(Logger_Level level) } } -static void toxcore_logger_callback(void *context, Logger_Level level, const char *file, int line, +static void toxcore_logger_callback(void *context, Logger_Level level, const char *file, uint32_t line, const char *func, const char *message, void *userdata) { - log_write(logger_level_to_log_level(level), "%s:%d(%s) %s\n", file, line, func, message); + log_write(logger_level_to_log_level(level), "%s:%u(%s) %s\n", file, line, func, message); } static volatile sig_atomic_t caught_signal = 0; diff --git a/toxcore/logger.c b/toxcore/logger.c index 69d7f50fc3..4442b59817 100644 --- a/toxcore/logger.c +++ b/toxcore/logger.c @@ -57,7 +57,7 @@ void logger_callback_log(Logger *log, logger_cb *function, void *context, void * log->userdata = userdata; } -void logger_write(const Logger *log, Logger_Level level, const char *file, int line, const char *func, +void logger_write(const Logger *log, Logger_Level level, const char *file, uint32_t line, const char *func, const char *format, ...) { if (log == nullptr) { diff --git a/toxcore/logger.h b/toxcore/logger.h index 1c7c0077e2..a92437b290 100644 --- a/toxcore/logger.h +++ b/toxcore/logger.h @@ -33,7 +33,7 @@ typedef enum Logger_Level { typedef struct Logger Logger; -typedef void logger_cb(void *context, Logger_Level level, const char *file, int line, +typedef void logger_cb(void *context, Logger_Level level, const char *file, uint32_t line, const char *func, const char *message, void *userdata); /** @@ -66,7 +66,7 @@ void logger_callback_log(Logger *log, logger_cb *function, void *context, void * */ non_null(3, 5, 6) nullable(1) GNU_PRINTF(6, 7) void logger_write( - const Logger *log, Logger_Level level, const char *file, int line, const char *func, + const Logger *log, Logger_Level level, const char *file, uint32_t line, const char *func, const char *format, ...); /* @brief Terminate the program with a signal. */ diff --git a/toxcore/tox.c b/toxcore/tox.c index ccb0a29e84..70f96084ad 100644 --- a/toxcore/tox.c +++ b/toxcore/tox.c @@ -79,7 +79,7 @@ struct Tox_Userdata { static logger_cb tox_log_handler; non_null(1, 3, 5, 6) nullable(7) -static void tox_log_handler(void *context, Logger_Level level, const char *file, int line, const char *func, +static void tox_log_handler(void *context, Logger_Level level, const char *file, uint32_t line, const char *func, const char *message, void *userdata) { Tox *tox = (Tox *)context;