i3
|
#include <stdarg.h>
#include <stdbool.h>
Go to the source code of this file.
Macros | |
#define | LOG(fmt,...) verboselog(fmt, ##__VA_ARGS__) |
__VA_ARGS__ means: leave out VA_ARGS completely if it is empty, thatis, delete the preceding comma More... | |
#define | ELOG(fmt,...) errorlog("ERROR: " fmt, ##__VA_ARGS__) |
#define | DLOG(fmt,...) debuglog("%s:%s:%d - " fmt, I3__FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__) |
Functions | |
void | init_logging (void) |
Initializes logging by creating an error logfile in /tmp (or XDG_RUNTIME_DIR, see get_process_filename()). More... | |
void | open_logbuffer (void) |
Opens the logbuffer. More... | |
void | close_logbuffer (void) |
Closes the logbuffer. More... | |
bool | get_debug_logging (void) |
Checks if debug logging is active. More... | |
void | set_debug_logging (const bool _debug_logging) |
Set debug logging. More... | |
void | set_verbosity (bool _verbose) |
Set verbosity of i3. More... | |
void | debuglog (char *fmt,...) __attribute__((format(printf |
Logs the given message to stdout while prefixing the current time to it, but only if debug logging was activated. More... | |
void void | errorlog (char *fmt,...) __attribute__((format(printf |
Logs the given message to stdout while prefixing the current time to it. More... | |
void void void | verboselog (char *fmt,...) __attribute__((format(printf |
Logs the given message to stdout while prefixing the current time to it, but only if verbose mode is activated. More... | |
void void void void | purge_zerobyte_logfile (void) |
Deletes the unused log files. More... | |
Variables | |
char * | errorfilename |
char * | shmlogname |
int | shmlog_size |
#define DLOG | ( | fmt, | |
... | |||
) | debuglog("%s:%s:%d - " fmt, I3__FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__) |
Definition at line 28 of file log.h.
Referenced by _create___i3(), _tree_next(), _workspace_apply_default_orientation(), _workspace_show(), add_subscription(), append_argument(), assignment_for(), backtrace(), CFGFUN(), cmd_bar_hidden_state(), cmd_bar_mode(), cmd_border(), cmd_criteria_add(), cmd_criteria_match_windows(), cmd_exec(), cmd_floating(), cmd_focus(), cmd_focus_direction(), cmd_focus_level(), cmd_focus_output(), cmd_focus_window_mode(), cmd_fullscreen(), cmd_kill(), cmd_layout(), cmd_layout_toggle(), cmd_mark(), cmd_mode(), cmd_move_con_to_output(), cmd_move_con_to_workspace(), cmd_move_con_to_workspace_back_and_forth(), cmd_move_con_to_workspace_name(), cmd_move_con_to_workspace_number(), cmd_move_direction(), cmd_move_scratchpad(), cmd_move_window_to_center(), cmd_move_window_to_position(), cmd_move_workspace_to_output(), cmd_resize(), cmd_scratchpad_show(), cmd_split(), cmd_unmark(), cmd_workspace(), cmd_workspace_name(), con_accepts_window(), con_attach(), con_border_style(), con_border_style_rect(), con_descend_direction(), con_focus(), con_get_next(), con_is_floating(), con_minimum_size(), con_move_to_workspace(), con_new_skeleton(), con_next_focused(), con_on_remove_child(), con_orientation(), con_parent_with_orientation(), con_set_border_style(), con_set_layout(), con_set_urgency(), con_toggle_fullscreen(), con_toggle_layout(), contained_by_output(), create_workspace_on_output(), disable_randr(), drag_pointer(), DRAGGING_CB(), dump_node(), fake_absolute_configure_notify(), fake_outputs_init(), floating_drag_window(), floating_enable(), floating_fix_coordinates(), floating_maybe_reassign_ws(), floating_mod_on_tiled_client(), floating_raise_con(), floating_resize_window(), format_event(), get_output_containing(), get_output_next(), get_output_next_wrap(), grab_keycode_for_binding(), handle_button_press(), handle_client_message(), handle_configure_request(), handle_destroy_notify_event(), handle_enter_notify(), handle_expose_event(), handle_focus_in(), handle_hints(), handle_key_press(), handle_map_request(), handle_mapping_notify(), handle_motion_notify(), handle_normal_hints(), handle_output(), handle_screen_change(), handle_signal(), handle_transient_for(), handle_unmap_notify_event(), init_ws_for_output(), insert_con_into(), ipc_create_socket(), ipc_new_client(), ipc_receive_message(), json_boolean(), level_down(), main(), manage_window(), maybe_auto_back_and_forth_workspace(), maybe_back_and_forth(), nagbar_exited(), output_change_mode(), output_init_con(), parse_command(), parse_config(), parse_file(), query_screens(), randr_query_outputs(), render_con(), render_l_output(), resize_graphical_handler(), restore_geometry(), route_click(), run_assignments(), scratchpad_fix_resolution(), scratchpad_move(), scratchpad_show(), send_take_focus(), sig_handle_key_press(), start_nagbar(), startup_monitor_event(), startup_sequence_delete(), startup_sequence_get(), startup_workspace_for_window(), TAILQ_HEAD(), tiling_resize(), tiling_resize_for_border(), translate_keysyms(), tree_close(), tree_flatten(), tree_move(), tree_open_con(), tree_render(), tree_restore(), tree_split(), ungrab_all_keys(), window_update_class(), window_update_hints(), window_update_leader(), window_update_name(), window_update_name_legacy(), window_update_role(), window_update_strut_partial(), window_update_transient_for(), workspace_attach_to(), workspace_back_and_forth(), workspace_back_and_forth_get(), workspace_defer_update_urgent_hint_cb(), workspace_encapsulate(), workspace_prev_on_output(), workspace_update_urgent_flag(), ws_force_orientation(), x_con_init(), x_draw_decoration(), x_move_win(), x_push_changes(), x_push_node(), x_push_node_unmaps(), x_reinit(), xcb_check_cb(), xinerama_init(), and xkb_got_event().
#define ELOG | ( | fmt, | |
... | |||
) | errorlog("ERROR: " fmt, ##__VA_ARGS__) |
#define LOG | ( | fmt, | |
... | |||
) | verboselog(fmt, ##__VA_ARGS__) |
void close_logbuffer | ( | void | ) |
Closes the logbuffer.
Definition at line 166 of file log.c.
References logbuffer, logbuffer_shm, and shmlogname.
Referenced by init_logging(), and open_logbuffer().
void debuglog | ( | char * | fmt, |
... | |||
) |
Logs the given message to stdout while prefixing the current time to it, but only if debug logging was activated.
void void errorlog | ( | char * | fmt, |
... | |||
) |
bool get_debug_logging | ( | void | ) |
Checks if debug logging is active.
Definition at line 187 of file log.c.
References debug_logging.
Referenced by cmd_debuglog().
void init_logging | ( | void | ) |
Initializes logging by creating an error logfile in /tmp (or XDG_RUNTIME_DIR, see get_process_filename()).
Definition at line 81 of file log.c.
References close_logbuffer(), errorfile, errorfilename, get_process_filename(), logbuffer, open_logbuffer(), purge_zerobyte_logfile(), and shmlog_size.
Referenced by cmd_shmlog(), and main().
void open_logbuffer | ( | void | ) |
Opens the logbuffer.
Definition at line 106 of file log.c.
References close_logbuffer(), i3_shmlog_header::condvar, logbuffer, logbuffer_shm, logbuffer_size, loglastwrap, logwalk, min(), sasprintf(), shmlog_size, shmlogname, and store_log_markers().
Referenced by init_logging().
void void void void purge_zerobyte_logfile | ( | void | ) |
Deletes the unused log files.
Useful if i3 exits immediately, eg. because –get-socketpath was called. We don't care for syscall failures. This function is invoked automatically when exiting.
Definition at line 325 of file log.c.
References errorfilename.
Referenced by init_logging().
void set_debug_logging | ( | const bool | _debug_logging | ) |
Set debug logging.
Definition at line 195 of file log.c.
References debug_logging.
Referenced by cmd_debuglog(), and main().
void set_verbosity | ( | bool | _verbose | ) |
void void void verboselog | ( | char * | fmt, |
... | |||
) |
char* errorfilename |
Definition at line 38 of file log.c.
Referenced by handle_key_press(), init_logging(), parse_file(), and purge_zerobyte_logfile().
int shmlog_size |
Definition at line 47 of file log.c.
Referenced by cmd_shmlog(), init_logging(), main(), and open_logbuffer().
char* shmlogname |
Definition at line 44 of file log.c.
Referenced by close_logbuffer(), handle_signal(), i3_exit(), open_logbuffer(), and update_shmlog_atom().