Commit Graph

14 Commits

Author SHA1 Message Date
Yuxuan Shui f5bebb3e2e
plugin: add picom API headers
And add a pkgconfig file so they can be found.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2024-05-25 11:08:43 +01:00
Yuxuan Shui 43de276c19
options: refactor option parsing
The main objective is to remove the need to worry about option value
assignment. Because of the way getopt works, we need to assign a number
to each option, and later match the return value of getopt in a big
switch. We have to make sure to not assign the same number to two
options, and we have to carefully make sure the same number is used in
two different places (once in the options table, once in the switch).
And that is just annoying.

With this commit everything is in one place, and the compiler will yell
at us if we assigned duplicated numbers.

Maybe this can also be a stepping stone for unifying command line
options parsing and config file parsing.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2024-05-12 17:16:02 +01:00
Yuxuan Shui aed2a205ed
log: add a new log level, verbose
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-12-18 04:11:18 +00:00
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