src/log.c File Reference

#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <stdlib.h>
#include <sys/time.h>
#include "util.h"
#include "log.h"
#include "loglevels.h"
Include dependency graph for log.c:

Go to the source code of this file.

Functions

void init_logging ()
 Initializes logging by creating an error logfile in /tmp (or XDG_RUNTIME_DIR, see get_process_filename()).
void set_verbosity (bool _verbose)
 Set verbosity of i3.
void add_loglevel (const char *level)
 Enables the given loglevel.
void vlog (char *fmt, va_list args)
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 errorlog (char *fmt,...)
 Logs the given message to stdout while prefixing the current time to it.
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.

Variables

static uint64_t loglevel = 0
static bool verbose = true
static FILE * errorfile
char * errorfilename

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 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:

void vlog ( char *  fmt,
va_list  args 
)

Definition at line 84 of file log.c.

Referenced by debuglog(), errorlog(), and verboselog().


Variable Documentation

FILE* errorfile [static]

Definition at line 28 of file log.c.

Referenced by errorlog(), and init_logging().

Definition at line 29 of file log.c.

Referenced by init_logging(), and start_configerror_nagbar().

uint64_t loglevel = 0 [static]

Definition at line 26 of file log.c.

Referenced by add_loglevel(), and debuglog().

bool verbose = true [static]

Definition at line 27 of file log.c.

Referenced by set_verbosity(), and verboselog().


Generated on 6 Aug 2011 for i3 by  doxygen 1.6.1