diff --git a/src/frontend/libslirp/CMakeLists.txt b/src/frontend/libslirp/CMakeLists.txt index 6b9f5788..cd4dea5a 100644 --- a/src/frontend/libslirp/CMakeLists.txt +++ b/src/frontend/libslirp/CMakeLists.txt @@ -52,6 +52,7 @@ target_include_directories(slirp PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/src") target_include_directories(slirp PUBLIC "${CMAKE_CURRENT_BINARY_DIR}") target_compile_definitions(slirp PRIVATE BUILDING_LIBSLIRP) +target_compile_definitions(slirp PRIVATE "G_LOG_DOMAIN=\"Slirp\"") if (WIN32) target_link_libraries(slirp PRIVATE ws2_32 iphlpapi) diff --git a/src/frontend/libslirp/glib/glib.h b/src/frontend/libslirp/glib/glib.h index 08a43072..e979b12a 100644 --- a/src/frontend/libslirp/glib/glib.h +++ b/src/frontend/libslirp/glib/glib.h @@ -87,10 +87,10 @@ typedef int gint; typedef size_t gsize; typedef void* gpointer; -#define g_debug printf -#define g_warning printf -#define g_error printf -#define g_critical printf +#define g_debug(format, ...) printf("[" G_LOG_DOMAIN ": debug] " format, ##__VA_ARGS__) +#define g_warning(format, ...) printf("[" G_LOG_DOMAIN ": warning] " format, ##__VA_ARGS__) +#define g_error(format, ...) printf("[" G_LOG_DOMAIN ": error] " format, ##__VA_ARGS__) +#define g_critical(format, ...) printf("[" G_LOG_DOMAIN ": critical] " format, ##__VA_ARGS__) #define g_new(type, count) (type*) (count > 0 ? malloc(sizeof(type) * count) : NULL) #define g_new0(type, count) (type*) (count > 0 ? calloc(count, sizeof(type)) : NULL)