2 Copyright (c) 2002, Thomas Kurschel
9 As syslog is very slow and tends to loose
10 data if its buffer overflows (which occurs much
11 too often), this module provides a fast (and memory-
12 wasting) logging mechanism. You need a seperate
13 application to retrieve the log.
15 Everything is thread-safe.
19 #ifndef __LOG_COLL_H__
20 #define __LOG_COLL_H__
22 #include <SupportDefs.h>
24 // by undefining this flag, all logging functions
25 // are resolved to empty space, so don't add
26 // extra tests in your code
28 //#define ENABLE_LOGGING
31 // add log entry with 0..3 (uint32) data
32 #define LOG( li, what ) log( li, what, 0 )
33 #define LOG1( li, what, arg1 ) log( li, what, 1, arg1 );
34 #define LOG2( li, what, arg1, arg2 ) log( li, what, 2, arg1, arg2 );
35 #define LOG3( li, what, arg1, arg2, arg3 ) log( li, what, 3, arg1, arg2, arg3 );
39 typedef struct log_entry_t
{
48 #if defined(__cplusplus)
54 void log( struct log_info_t
*li
, uint16 what
, const uint8 num_args
, ... );
56 #define log( a, b, c... )
60 // define LOG_INCLUDE_STARTUP in your device driver
61 #ifdef LOG_INCLUDE_STARTUP
63 uint32
log_getsize( struct log_info_t
*li
);
64 void log_getcopy( struct log_info_t
*li
, void *dest
, uint32 max_size
);
68 struct log_info_t
*log_init( uint32 size
);
69 void log_exit( struct log_info_t
*li
);
73 #define log_init( a ) NULL
80 #if defined(__cplusplus)