src/log.c File Reference

#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include <stdbool.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 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 (int 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 uint32_t loglevel = 0
static bool verbose = false

Function Documentation

void add_loglevel ( const char *  level  ) 

Enables the given loglevel.

Definition at line 41 of file log.c.

References loglevel, loglevels, and UINT32_MAX.

Referenced by main().

void debuglog ( int  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 112 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 98 of file log.c.

References vlog().

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 33 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 83 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 65 of file log.c.

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


Variable Documentation

uint32_t loglevel = 0 [static]

Definition at line 24 of file log.c.

Referenced by add_loglevel(), and debuglog().

bool verbose = false [static]

Definition at line 25 of file log.c.

Referenced by set_verbosity(), and verboselog().


Generated on 2 Jul 2010 for i3 by  doxygen 1.6.1