debug.cpp File Reference

Debug log implementation. More...

#include "defines.h"
#include "assert.h"
#include <stdio.h>
#include <stdarg.h>
#include <iostream>

Typedefs

typedef void(* log_t )(const char *format, va_list args)
typedef void(* init_log_t )(log_t log)

Functions

void _open_log (const char *path, bool console)
void _close_log ()
void _dll_init_log (void *dlHandle)
DEBUG_EXPORT void init_log (log_t log)
void _log (const char *format,...)
void _logfoo (const char *,...)

Variables

log_t log_cb = __logfoo


Detailed Description

Debug log implementation.

© 2003-2004 by Rene Mayrhofer, Harald Radi

Date
2004-02-12 21:08:39 +0100 (Don, 12 Feb 2004)
Revision
612

Since:
Sat Aug 30 2003
Author:
Rene Mayrhofer <rene@mayrhofer.eu.org>

Harald Radi <harald.radi@nme.at>


This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

Id
debug.cpp 612 2004-02-12 20:08:39Z harald

Typedef Documentation

typedef void(* init_log_t)(log_t log)
 

Function type definitions for initializing logging

typedef void(* log_t)(const char *format, va_list args)
 

Function type definitions for logging


Function Documentation

void _close_log  ) 
 

Close the logfile

void _dll_init_log void *  dll  ) 
 

Loads the main logging module into dynamically loaded libraries to ensure that logging is performed synchronously into a single logfile.

Parameters:
dll Handle to the dynamically loaded library

void _log const char *  format,
  ...
 

Wrapper function to convert printf style parameters into va_list style parameters.

Parameters:
format printf style format string
... Additional parameters

void _logfoo const char *  format,
  ...
 

dummy function if logging is disabled

See also:
_log
Todo:
gcc supports 'args...' macros, afaik ms doesn't - check, would be a nicer hack

void _open_log const char *  path,
bool  console
 

Initialize the logfile

Parameters:
path Filename of the logfile or NULL if no logfile should be written.
console true if the log should be printed to the console, false otherwise.
Remarks:
Not every platform provides a console, writing a logfile is the only possibility of logging information there.

DEBUG_EXPORT void init_log log_t  log  ) 
 

Exported funtion to initialize logging

Parameters:
log Logging function


Variable Documentation

log_t log_cb = __logfoo
 

Globally used logging function set by the init_log function


Generated on Mon Jun 5 10:20:48 2006 for Intelligence.kdevelop by  doxygen 1.4.6