Main Page | Modules | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

event_log.c File Reference


Detailed Description

For internal use only.

This file contains the implementations of various log control functions and the default logging function for the library.

Definition in file event_log.c.

#include "event_int.h"
#include <stdarg.h>
#include <stdio.h>

Include dependency graph for event_log.c:

Go to the source code of this file.

Defines

#define DEBUG_BUF
 Debug message buffer size.

Functions

static void deflog (const char *file, int line, const char *func, const char *msg)
 Default logging routine.
ev_err_t event_log_set (ev_log_t logger)
 Set a logging function.
ev_err_t event_log_reset (void)
 Reset library logging.
ev_err_t event_log_debug (int onoff)
 Turn library logging on or off.
ev_err_t event_log_trace (int onoff)
 Turn library function tracing on or off.
ev_err_t event_log_abort (int onoff)
 Turn library abort on or off.
void _ev_debug (ev_flags_t flags, const char *file, int line, const char *func, const char *fmt,...)
 Log debugging messages.

Variables

ev_flags_t _ev_asflags
 Library logging flags.
ev_log_t _ev_debuglog
 Library logging function callback.


Define Documentation

#define DEBUG_BUF
 

For internal use only.

This macro contains the maximum size of a debug message.

Definition at line 39 of file event_log.c.

Referenced by _ev_debug().


Function Documentation

void _ev_debug ev_flags_t  flags,
const char *  file,
int  line,
const char *  func,
const char *  fmt,
  ...
 

For internal use only.

This function is used when the ev_log() macro is insufficient. It will call snprintf() to format a log message, then call the user logging function to log the message.

Test:
This function is tested in t_event_log.c.
Parameters:
[in] flags One of EVAS_LOG or EVAS_TRACE; if the flag is set in _ev_asflags, msg will be logged.
[in] file The file name.
[in] line The line number in the file.
[in] func The name of the containing function, or NULL if function names are not available.
[in] fmt The format string.

Definition at line 134 of file event_log.c.

References _ev_asflags, _ev_debuglog, and DEBUG_BUF.

Referenced by engine_load(), event_destroy(), and main().

static void deflog const char *  file,
int  line,
const char *  func,
const char *  msg
[static]
 

For internal use only.

This is the default routine for the event library logging. It simply prints the msg parameter (along with the file, line, and func parameters) to stderr.

Parameters:
[in] file The file name.
[in] line The line number in the file.
[in] func The name of the containing function, or NULL if function names are not available.
[in] msg The log message.

Definition at line 58 of file event_log.c.

Referenced by event_log_reset().


Variable Documentation

ev_flags_t _ev_asflags
 

For internal use only.

This variable contains a set of flags controlling the logging and assertion behavior of the library. The available flags are EVAS_LOG, EVAS_ABORT, EVAS_LOOP, and EVAS_TRACE. This variable should only be manipulated by means of the event_log_debug(), event_log_trace(), and event_log_abort() functions.

Definition at line 41 of file event_log.c.

Referenced by _ev_debug(), event_log_abort(), event_log_debug(), event_log_reset(), event_log_set(), event_log_trace(), and main().

ev_log_t _ev_debuglog
 

For internal use only.

This variable contains a pointer to the function to be used for logging. See the documentation for the ev_log_t type for more information. It should only be manipulated by means of event_log_set() and event_log_reset().

Definition at line 64 of file event_log.c.

Referenced by _ev_debug(), event_log_reset(), event_log_set(), and main().


Generated on Wed Dec 28 23:37:21 2005 for event by  doxygen 1.4.4