l4log.h File Reference

Logging facility - Macros and function declaration. More...

Go to the source code of this file.

Defines

#define LOG_init(arg)   LOG_init_is_deprecated=0
#define LOG_DEBUG   0
 an allways-defined DEBUG flag
#define STRINGIFY_HELPER(nr)   #nr
#define LINE_PRESCAN_SUBST(ln)   STRINGIFY_HELPER(ln)
#define __LINE_STR__   LINE_PRESCAN_SUBST(__LINE__)
#define LOG(a...)
#define LOGl(a...)
#define LOGL(a...)
#define LOG_Enter(a...)
#define LOGk(a...)
#define LOGd_Enter(doit, msg...)   do { if(doit) LOG_Enter(msg); } while (0)
#define LOGd(doit, msg...)   do { if(doit) LOG(msg); } while (0)
#define LOGdl(doit, msg...)   do { if(doit) LOGl(msg); } while (0)
#define LOGdL(doit, msg...)   do { if(doit) LOGL(msg); } while (0)
#define LOGdk(doit, msg...)   do { if(doit) LOGk(msg); } while (0)
#define LOG_Error(msg...)   LOGL("Error: " msg)
#define LOG_logk(format...)

Functions

L4_CV void LOG_setup_tag (void)
 Set the LOG tag.
L4_CV void LOG_outstring_fiasco_tbuf (const char *log_message)
 Log-output function printing to the fiasco tracebuffer.
L4_CV void LOG_flush (void)
 flush all buffered data.
L4_CV void LOG_log (const char *function, const char *format,...)
L4_CV void LOG_logl (const char *file, int line, const char *function, const char *format,...)
L4_CV void LOG_logL (const char *file, int line, const char *function, const char *format,...)
L4_CV void LOG_format_check (const char *format,...) __attribute__((format(printf

Variables

EXTERN_C_BEGIN char LOG_tag [9]
 Symbol defining the logtag.
L4_CV void(* LOG_outstring )(const char *log_message)
 variable containing the text output function


Detailed Description

Logging facility - Macros and function declaration.

Date:
03/14/2001
Author:
Jork Loeser <jork.loeser@inf.tu-dresden.de>

Definition in file l4log.h.


Define Documentation

#define LOG ( a...   ) 

Value:

do {                            \
  if(0)LOG_format_check(a);                     \
  LOG_log(__FUNCTION__, a);                     \
} while(0)

Definition at line 101 of file l4log.h.

#define LOG_Enter ( a...   ) 

Value:

do {                    \
  if(0)LOG_format_check("called "a);            \
  LOG_log(__FUNCTION__, "called "a);            \
} while(0)

Definition at line 116 of file l4log.h.

#define LOG_logk ( format...   ) 

Value:

do {                                     \
                                   char buf[35];                          \
                                   LOG_snprintf(buf,sizeof(buf),format);  \
                                   LOG_outstring_fiasco_tbuf(buf);        \
                                 } while (0)

Definition at line 133 of file l4log.h.

#define LOGk ( a...   ) 

Value:

do {                            \
  if(0)LOG_format_check(a);                     \
  LOG_logk(a);                                  \
} while(0)

Definition at line 121 of file l4log.h.

#define LOGL ( a...   ) 

Value:

do {                            \
  if(0)LOG_format_check(a);                     \
  LOG_logL(__FILE__,__LINE__,__FUNCTION__, a);  \
} while(0)

Definition at line 111 of file l4log.h.

#define LOGl ( a...   ) 

Value:

do {                            \
  if(0)LOG_format_check(a);                     \
  LOG_logl(__FILE__,__LINE__,__FUNCTION__, a);  \
} while(0)

Definition at line 106 of file l4log.h.


Function Documentation

L4_CV void LOG_flush ( void   ) 

flush all buffered data.

This function ensures that all data logged so far is actually printed. If used with the logserver, the logserver flushs all its buffered data.

L4_CV void LOG_outstring_fiasco_tbuf ( const char *  log_message  ) 

Log-output function printing to the fiasco tracebuffer.

This specific version of a text output function uses the fiasco tracebuffer as output channel.

L4_CV void LOG_setup_tag ( void   ) 

Set the LOG tag.

This function should be called by the startup-code, prior to any output of the loglib (if used) or the thread-creation using the thread package. If l4util_progname is empty, it will be filled with the first 8 chars of the last portion of the program name.

With L4Env, this function is called after initializing l4util's argc/argv. It is called via constructors a second time before calling main(). Without L4Env and the __main() from l4util, this function is called as constructor after initializing argc/argv.

Definition at line 37 of file log_init.c.


Variable Documentation

L4_CV void(* LOG_outstring)(const char *log_message)

variable containing the text output function

This variable holds the function to output the formated string. You can re-initialize it to use your own function. In non-server-mode this points to a putchar-loop, in server-mode a string-ipc-function will be used.

EXTERN_C_BEGIN char LOG_tag[9]

Symbol defining the logtag.

This is a weak symbol which can be overwritten to define the logtag. The intention is that you can set the logtag on compile-time, if you cannot guarantee to call LOG_init() prior to first output for whatever reasons.

Use one of the two methods to define the logtag, either by defining this symbol or by calling LOG_init().

Note:
The length of the symbol must be 9 characters in length, and it must be 0-terminated.
See also:
LOG_init()

Definition at line 55 of file logserver.c.


Generated on Wed Apr 11 06:40:52 2012 for Logging and output facility for DROPS by  doxygen 1.5.6