aboutsummaryrefslogtreecommitdiff
path: root/common/log.c
AgeCommit message (Collapse)AuthorLines
2024-02-16Define _POSIX_C_SOURCE globallyFurkan Sahin-1/+0
See discussion in https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4555
2020-12-10common/log: write log importanceFurkan Sahin-0/+9
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. This is [1] ported to Sway. [1]: https://github.com/swaywm/wlroots/pull/2149
2020-05-23common/log: use bright black rather than black for SWAY_DEBUGFurkan Sahin-1/+1
On some terminals under default settings, black is truly rendered as `#000`, making it unreadable when the background is also black. Closes #5141.
2020-03-07common/log: bump POSIX version used after f98a89f3f1caFurkan Sahin-1/+1
../common/log.c:63:16: error: use of undeclared identifier 'CLOCK_MONOTONIC' clock_gettime(CLOCK_MONOTONIC, &start_time); ^ ../common/log.c:75:16: error: use of undeclared identifier 'CLOCK_MONOTONIC' clock_gettime(CLOCK_MONOTONIC, &ts); ^
2020-03-05common/log: improve time prefixFurkan Sahin-8/+30
Same as [1]. [1]: https://github.com/swaywm/wlroots/pull/2052
2019-06-22Use -fmacro-prefix-map to strip build pathFurkan Sahin-17/+0
Because meson does not provide a simple way to get the relative build path, it is computed with a pair of foreach loops. As meson does not have a simple way to compute string length (except via underscorify and 63 split operations), the build script uses a shell command instead. If the compiler does not suppot -fmacro-prefix-map, then fall back to passing in the relative path prefix, and use its length to offset the uses of __FILE__ in log messages so that the build path is at least still not included in the logs. This is significantly more efficient than calling _sway_strip_path.
2019-01-20Replace wlr_log with sway_logFurkan Sahin-4/+85
This commit mostly duplicates the wlr_log functions, although with a sway_* prefix. (This is very similar to PR #2009.) However, the logging function no longer needs to be replaceable, so sway_log_init's second argument is used to set the exit callback for sway_abort. wlr_log_init is still invoked in sway/main.c This commit makes it easier to remove the wlroots dependency for the helper programs swaymsg, swaybg, swaybar, and swaynag.
2018-07-09Update for swaywm/wlroots#1126Furkan Sahin-2/+2
2018-01-05common/log: finish removing most log functionsFurkan Sahin-145/+4
Keep sway_abort and sway_assert and convert them to use wlr_log functions
2017-11-18Move everything to sway/old/Furkan Sahin-1/+1
2017-10-20Print log level even if STDERR is not a ttyFurkan Sahin-5/+18
Makes reading debug logs much easier, debug lines will start with `E`, info lines with `I` and error lines with `E`.
2017-06-05FreeBSD fixesFurkan Sahin-1/+1
Increase _POSIX_SOURCE value where needed. Increase _XOPEN_SOURCE value where needed. Conditionally link to libcap (only on Linux). Possibly some trailing whitespace fixes (automatic).
2017-04-20Make sway_abort() report locationFurkan Sahin-10/+9
2017-04-16Fix location reported by sway_assertFurkan Sahin-2/+2
2017-04-16Fix variadic forwarding in sway_assertFurkan Sahin-5/+10
_sway_assert is a variadic function which tries to delegate to another variadic function. This requires a vprintf-style variant of the delegate. https://stackoverflow.com/a/150616
2017-03-10UnGNUify the codebaseFurkan Sahin-0/+1
2016-12-15Handle malloc failure in ipc_recv_responseFurkan Sahin-3/+8
2016-09-01Reorganize includesFurkan Sahin-9/+7
2016-07-28Add timestamp to log messagesFurkan Sahin-0/+15
2016-07-17Remove SIGSERV and SIGABORT handlerFurkan Sahin-46/+1
From now on let's just let the core dumps happen and ask users to provide them.
2016-06-27Add get_log_level() to encapsulate v (current log level)Furkan Sahin-3/+7
This patch also makes all global variable in log.c static.
2016-05-02common: refactor sway_log()Furkan Sahin-9/+6
This removes most preprocessor logic, leaving it only it the header.
2016-05-02common: fix double-close in error_handler()Furkan Sahin-3/+1
2016-05-02Fix off-by-one bug in log functionsFurkan Sahin-2/+2
2016-02-26Correctly exit sway on errors.Furkan Sahin-1/+1
Calling `exit` in sway_terminate prevents sway from correctly shutting down (freeing data, cleanly terminating the ipc server, etc.). A better way is to exit straight away if the failure occurs before `wlc_run` and use sway_abort as usual if it occur when wlc is running.
2016-02-08Fix clang warningsFurkan Sahin-1/+1
2016-01-28Print /proc/<pid>/maps on segfaultFurkan Sahin-0/+20
2015-12-21use CMake's FindBacktrace for backtrace feature detectionFurkan Sahin-1/+4
2015-11-12Start fleshing out wayland client implementationFurkan Sahin-0/+159
This introduces a basic shared framework for making wayland clients within sway itself.