include/log.h File Reference

#include <stdarg.h>
#include <stdbool.h>
Include dependency graph for log.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define LOG(fmt,...)   verboselog(fmt, ##__VA_ARGS__)
 #__VA_ARGS__ means: leave out __VA_ARGS__ completely if it is empty, that is, delete the preceding comma
#define ELOG(fmt,...)   errorlog("ERROR: " fmt, ##__VA_ARGS__)
#define DLOG(fmt,...)   debuglog(LOGLEVEL, "%s:%s:%d - " fmt, __FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__)

Functions

void init_logging ()
 Initializes logging by creating an error logfile in /tmp (or XDG_RUNTIME_DIR, see get_process_filename()).
void add_loglevel (const char *level)
 Enables the given loglevel.
void set_verbosity (bool _verbose)
 Set verbosity of i3.
void debuglog (uint64_t lev, char *fmt,...)
 Logs the given message to stdout while prefixing the current time to it, but only if the corresponding debug loglevel was activated.
void errorlog (char *fmt,...)
 Logs the given message to stdout while prefixing the current time to it.
void verboselog (char *fmt,...)
 Logs the given message to stdout while prefixing the current time to it, but only if verbose mode is activated.
void slog (char *fmt, va_list args)
 Logs the given message to stdout while prefixing the current time to it.

Variables

char * loglevels []
char * errorfilename

Define Documentation

#define DLOG ( fmt,
...   )     debuglog(LOGLEVEL, "%s:%s:%d - " fmt, __FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__)

Definition at line 21 of file log.h.

Referenced by _tree_next(), add_subscription(), append_argument(), assignment_for(), con_accepts_window(), con_attach(), con_border_style(), con_focus(), con_for_window(), con_get_next(), con_is_floating(), con_minimum_size(), con_move_to_workspace(), con_new(), con_next_focused(), con_on_remove_child(), con_parent_with_orientation(), con_set_layout(), con_toggle_fullscreen(), disable_randr(), drag_pointer(), DRAGGING_CB(), ewmh_update_workarea(), fake_absolute_configure_notify(), floating_drag_window(), floating_enable(), floating_maybe_reassign_ws(), floating_mod_on_tiled_client(), floating_raise_con(), floating_resize_window(), format_event(), get_output_containing(), grab_keycode_for_binding(), handle_button_press(), handle_client_message(), handle_configure_request(), handle_destroy_notify_event(), handle_enter_notify(), handle_event(), handle_expose_event(), handle_focus_in(), handle_hints(), handle_key_press(), handle_map_request(), handle_mapping_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(), ipc_send_message(), json_start_map(), main(), manage_window(), output_change_mode(), output_init_con(), parse_configuration(), parse_file(), property_notify(), query_screens(), randr_query_outputs(), render_con(), render_l_output(), resize_graphical_handler(), restore_geometry(), route_click(), run_assignments(), send_take_focus(), sig_handle_key_press(), tiling_resize(), tiling_resize_for_border(), translate_keysyms(), tree_close(), tree_flatten(), tree_move(), tree_open_con(), tree_render(), tree_split(), ungrab_all_keys(), window_update_class(), window_update_leader(), window_update_name(), window_update_name_legacy(), window_update_strut_partial(), window_update_transient_for(), workspace_attach_to(), workspace_get(), workspace_show(), 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(), xkb_got_event(), and yyparse().

#define ELOG ( fmt,
...   )     errorlog("ERROR: " fmt, ##__VA_ARGS__)
#define LOG ( fmt,
...   )     verboselog(fmt, ##__VA_ARGS__)

Function Documentation

void add_loglevel ( const char *  level  ) 

Enables the given loglevel.

Definition at line 60 of file log.c.

References loglevel, and loglevels.

Referenced by main().

void debuglog ( uint64_t  lev,
char *  fmt,
  ... 
)

Logs the given message to stdout while prefixing the current time to it, but only if the corresponding debug loglevel was activated.

Definition at line 143 of file log.c.

References loglevel, and vlog().

Here is the call graph for this function:

void errorlog ( char *  fmt,
  ... 
)

Logs the given message to stdout while prefixing the current time to it.

Definition at line 123 of file log.c.

References errorfile, and vlog().

Here is the call graph for this function:

void init_logging (  ) 

Initializes logging by creating an error logfile in /tmp (or XDG_RUNTIME_DIR, see get_process_filename()).

Definition at line 36 of file log.c.

References ELOG, errorfile, errorfilename, and get_process_filename().

Referenced by main().

Here is the call graph for this function:

void set_verbosity ( bool  _verbose  ) 

Set verbosity of i3.

If verbose is set to true, informative messages will be printed to stdout. If verbose is set to false, only errors will be printed.

Definition at line 52 of file log.c.

References verbose.

Referenced by main().

void slog ( char *  fmt,
va_list  args 
)

Logs the given message to stdout while prefixing the current time to it.

This is to be called by LOG() which includes filename/linenumber

void verboselog ( char *  fmt,
  ... 
)

Logs the given message to stdout while prefixing the current time to it, but only if verbose mode is activated.

Definition at line 108 of file log.c.

References verbose, and vlog().

Here is the call graph for this function:


Variable Documentation

Definition at line 29 of file log.c.

Referenced by init_logging(), and start_configerror_nagbar().

char* loglevels[]

Definition at line 1 of file loglevels.h.

Referenced by add_loglevel().


Generated on 6 Aug 2011 for i3 by  doxygen 1.6.1