aboutsummaryrefslogtreecommitdiff
path: root/util/log.c
AgeCommit message (Collapse)Author
2024-02-15Define _POSIX_C_SOURCE globallySimon Ser
Stop trying to maintain a per-file _POSIX_C_SOURCE. Instead, require POSIX.1-2008 globally. A lot of core source files depend on that already. Some care must be taken on a few select files where we need a bit more than POSIX. Some files need XSI extensions (_XOPEN_SOURCE) and some files need BSD extensions (_DEFAULT_SOURCE). In both cases, these feature test macros imply _POSIX_C_SOURCE. Make sure to not define both these macros and _POSIX_C_SOURCE explicitly to avoid POSIX requirement conflicts (e.g. _POSIX_C_SOURCE says POSIX.1-2001 but _XOPEN_SOURCE says POSIX.1-2008). Additionally, there is one special case in render/vulkan/vulkan.c. That file needs major()/minor(), and these are system-specific. On FreeBSD, _POSIX_C_SOURCE hides system-specific symbols so we need to make sure it's not defined for this file. On Linux, we can explicitly include <sys/sysmacros.h> and ensure that apart from symbols defined there the file only uses POSIX toys.
2024-02-15util/log: drop unnecessary _XOPEN_SOURCESimon Ser
snprintf() is actually ISO C99. We still need POSIX for clock_gettime().
2023-06-29util/log: fix buffer overflowEvyatar Stalinsky
2020-06-06util/time: move `timespec_sub` to time utilitiesTudor Brindus
2020-05-24util/log: use bright black rather than black for WLR_DEBUGTudor Brindus
On some terminals under default settings, black is truly rendered as `#000`, making it unreadable when the background is also black. Refs swaywm/sway#5141.
2020-05-01util/log: write log importanceSimon Ser
When colors aren't used, write the log importance to stderr. This makes it easier to grep for errors and avoids mistaking error messages for debug messages.
2020-03-07util/log: improve time prefixSimon Ser
Log milliseconds. This is useful when debugging a rendering loop. Print the time relative to the compositor start-up.
2019-07-27Remove all wayland-server.h includesSimon Ser
The documentation for wayland-server.h says: > Use of this header file is discouraged. Prefer including > wayland-server-core.h instead, which does not include the server protocol > header and as such only defines the library PI, excluding the deprecated API > below. Replacing wayland-server.h with wayland-server-core.h allows us to drop the WL_HIDE_DEPRECATED declaration.
2019-07-17Use -fmacro-prefix-map to strip build pathManuel Stoeckl
This commit matches sway's 2dc4978d8af326c310057ca8fd22a4c7f5d09335. To help ensure a reproducible build (when debug info is disabled), the meson build script now uses the -fmacro-prefix-map command line argument supported by GCC to strip the build-path dependent bytes of each __FILE__ string used by wlr_log and related functions. A rather ugly algorithm is used to compute the relative path between the build and source folders, because meson has no specific function for this. When the compiler does not support -fmacro-prefix-map, fall back to shifting the start of each __FILE__ string by the length of the relative path to the source directory.
2019-04-07util/log: setup wayland log handleremersion
2018-09-01Add function wlr_log_get_verbosity()random human
Returns the verbosity passed to wlr_log_init().
2018-07-09util: add wlr_ prefix to log symbolsemersion
2018-04-25Remove wlr_ prefix from local symbolsemersion
2018-02-21Rename _strip_path to wlr_strip_pathGuido Günther
since it's a public function
2018-02-19Revert "ELF Visibility"Drew DeVault
2018-02-19Explicitly export EFL symbolsScott Anderson
2018-02-12Reformat all #include directivesemersion
2017-12-31Allow configurable verbosityCalvin Lee
2017-10-11Add FreeBSD compatibilityGreg V
2017-08-02Fix #40Drew DeVault
2017-06-21Utilize wlr_log in example loggingDrew DeVault
2017-06-21Reorganize wlr-commonDrew DeVault