mirror of
https://github.com/labwc/labwc.git
synced 2026-06-13 14:33:18 -04:00
add logger for config errors and <core><errorCommand> to display it.
This commit is contained in:
parent
477b3b1ddb
commit
4efb63f7da
10 changed files with 233 additions and 11 deletions
21
include/common/log.h
Normal file
21
include/common/log.h
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
#ifndef LABWC_LOG_H
|
||||
#define LABWC_LOG_H
|
||||
|
||||
#include <wlr/util/log.h>
|
||||
#include "common/buf.h"
|
||||
|
||||
struct buf *log_get_buf(void);
|
||||
void log_set_error(enum wlr_log_importance importance);
|
||||
void log_reset(void);
|
||||
void nag_show(void);
|
||||
void nag_show_callback(void *data);
|
||||
|
||||
#define nag_log(verb, fmt, ...) \
|
||||
do { \
|
||||
wlr_log(verb, fmt, ##__VA_ARGS__); \
|
||||
log_set_error(verb); \
|
||||
buf_add_fmt(log_get_buf(), fmt "\n", ##__VA_ARGS__); \
|
||||
} while (0)
|
||||
|
||||
#endif /* LABWC_LOG_H */
|
||||
|
|
@ -22,6 +22,19 @@ void spawn_async_no_shell(char const *command);
|
|||
*/
|
||||
void spawn_sync_no_shell(char const *command);
|
||||
|
||||
/**
|
||||
* spawn_piped_async_no_shell - execute asynchronously
|
||||
* @command: command to be executed
|
||||
* @pipe_fd_w: set to the write end of a pipe
|
||||
* connected to stdin of the command
|
||||
* Notes:
|
||||
* The returned pid_t has to be waited for to
|
||||
* not produce zombies and the pipe_fd_w has to
|
||||
* be closed. spawn_piped_close() can be used
|
||||
* to ensure both.
|
||||
*/
|
||||
pid_t spawn_piped_async_no_shell(const char *command, int *pipe_fd_w);
|
||||
|
||||
/**
|
||||
* spawn_piped - execute asynchronously
|
||||
* @command: command to be executed
|
||||
|
|
|
|||
|
|
@ -87,6 +87,7 @@ struct rcxml {
|
|||
bool xwayland_persistence;
|
||||
bool primary_selection;
|
||||
char *prompt_command;
|
||||
char *error_command;
|
||||
|
||||
/* placement */
|
||||
enum lab_placement_policy placement_policy;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue