Commit Graph

11 Commits

Author SHA1 Message Date
Yuxuan Shui 630d6f3a26
log: add log_error_errno
Prints error message with strerror(errno) attached, for convenience.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-02-26 20:16:55 +00:00
Yuxuan Shui ad3ec8cada
gl_common: initialize string marker logger
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:24 +01:00
Yuxuan Shui 350933a054
Cleanups
* Make some functions in win.c pure
* Remove unused code
* Fix misuse of attr_const, const functions shouldn't exam data pointed
  to by its pointer arguments.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-21 14:08:08 +00:00
Yuxuan Shui bb7466fc68
trace/debug logs are unlikely
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-13 04:11:41 +00:00
Yuxuan Shui 68c77cd7d8
Add log_remove_target
Don't need to deinit+init struct log any more just to switch log target
:)

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-07 21:50:20 +00:00
Yuxuan Shui abeb294508
Remove printf_* macros
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-20 17:36:23 +00:00
Yuxuan Shui 185c0ce97c
Guard log_printf in LOG macros with a log level check
So that the format arguments will only be evaluated if the log is
enabled by the log level. Allow us to add more expensive logs without
impact performance when they are not enabled.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-20 02:34:45 +00:00
Yuxuan Shui fc57c7b55b
Add a FATAL ERROR log level
For errors that cause compton to quit

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-20 02:02:08 +00:00
Yuxuan Shui d9409ae2c9
Add command line and config file option log-level
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-20 01:26:04 +00:00
Yuxuan Shui 1bcd7f2f7a
Add a simple logging framework
It's not very pretty now, but it will get better.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-20 01:02:56 +00:00
Yuxuan Shui 0cebbc370a
Function movements
* string functions mstr*() are moved to string_utils.c
* allocation wrappers are moved to utils.h
* printf_* functions are moved to log.h

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-15 17:43:36 +00:00