Skip to content

Commit

Permalink
enable structured logging
Browse files Browse the repository at this point in the history
The logging macros like g_message() will now use the structured logging
API directly (they already did before indirectly).
The structured log data will thus now contain additional information
like 'CODE_FILE', 'CODE_FUNC', or 'CODE_LINE'.

Signed-off-by: Enrico Jorns <[email protected]>
  • Loading branch information
ejoerns committed Aug 17, 2023
1 parent 3afe13e commit 70ec9f3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.56 gio-2.0 gio-unix-2.0])
# explicitly when using newer glib APIs
AC_DEFINE(GLIB_VERSION_MAX_ALLOWED, G_ENCODE_VERSION(2,56), [Prevent post-2.56 APIs])
AC_DEFINE(GLIB_VERSION_MIN_REQUIRED, G_ENCODE_VERSION(2,56), [Set to minimum supported API version])
AC_DEFINE([G_LOG_USE_STRUCTURED], [1], [Enable structured Logging])

AC_ARG_ENABLE([network],
AS_HELP_STRING([--disable-network], [Disable network update mode])
Expand Down
2 changes: 2 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ c_flags = [
'-DGLIB_VERSION_MAX_ALLOWED=G_ENCODE_VERSION(2,56)',
'-DGLIB_VERSION_MIN_REQUIRED=G_ENCODE_VERSION(2,56)'
]
# enable glib structured logging
c_flags += ['-DG_LOG_USE_STRUCTURED']

giodep = dependency('gio-2.0', version : '>=2.56')
giounixdep = dependency('gio-unix-2.0', version : '>=2.56')
Expand Down

0 comments on commit 70ec9f3

Please sign in to comment.