log4cplus  2.1.0
clogger.h
Go to the documentation of this file.
1 // -*- C -*-
27 #ifndef LOG4CPLUS_CLOGGERHEADER_
28 #define LOG4CPLUS_CLOGGERHEADER_
29 
30 #include <log4cplus/config.hxx>
31 
32 #if defined (LOG4CPLUS_HAVE_PRAGMA_ONCE)
33 #pragma once
34 #endif
35 
36 
37 #ifdef __cplusplus
38 extern "C"
39 {
40 #endif
41 
42 // TODO UNICDE capable
43 
44 typedef void * log4cplus_logger_t;
46 
49 
50 #define L4CP_OFF_LOG_LEVEL 60000
51 #define L4CP_FATAL_LOG_LEVEL 50000
52 #define L4CP_ERROR_LOG_LEVEL 40000
53 #define L4CP_WARN_LOG_LEVEL 30000
54 #define L4CP_INFO_LOG_LEVEL 20000
55 #define L4CP_DEBUG_LOG_LEVEL 10000
56 #define L4CP_TRACE_LOG_LEVEL 0
57 #define L4CP_ALL_LOG_LEVEL TRACE_LOG_LEVEL
58 #define L4CP_NOT_SET_LOG_LEVEL -1
59 
60 #ifdef UNICODE
61 typedef wchar_t log4cplus_char_t;
62 #else
63 typedef char log4cplus_char_t;
64 #endif // UNICODE
65 
66 #if ! defined (LOG4CPLUS_TEXT)
67 #ifdef UNICODE
68 # define LOG4CPLUS_TEXT2(STRING) L##STRING
69 #else
70 # define LOG4CPLUS_TEXT2(STRING) STRING
71 #endif // UNICODE
72 #define LOG4CPLUS_TEXT(STRING) LOG4CPLUS_TEXT2(STRING)
73 #endif // LOG4CPLUS_TEXT
74 
76 LOG4CPLUS_EXPORT int log4cplus_deinitialize(void * initializer);
77 
85 
88  const log4cplus_char_t *name, log4cplus_loglevel_t ll);
89 
91  log4cplus_loglevel_t ll, const log4cplus_char_t *msgfmt, ...)
92  LOG4CPLUS_FORMAT_ATTRIBUTE (__printf__, 3, 4);
93 
95  log4cplus_loglevel_t ll, const log4cplus_char_t *msg);
96 
98  log4cplus_loglevel_t ll, const log4cplus_char_t *msgfmt, ...)
99  LOG4CPLUS_FORMAT_ATTRIBUTE (__printf__, 3, 4);
100 
102  log4cplus_loglevel_t ll, const log4cplus_char_t *msg);
103 
105 typedef void (* log4cplus_log_event_callback_t)(void * cookie,
106  log4cplus_char_t const * message, log4cplus_char_t const * loggerName,
107  log4cplus_loglevel_t ll, log4cplus_char_t const * thread,
108  log4cplus_char_t const * thread2,
109  unsigned long long timestamp_secs, unsigned long timestamp_usecs,
110  log4cplus_char_t const * file, log4cplus_char_t const * function, int line);
111 
113  const log4cplus_char_t * logger, log4cplus_log_event_callback_t callback,
114  void * cookie);
115 
116 // Custom LogLevel
118  const log4cplus_char_t *ll_name);
120  const log4cplus_char_t *ll_name);
121 
122 #ifdef __cplusplus
123 }
124 #endif
125 
126 #endif /*?LOG4CPLUS_CLOGGERHEADER_*/
log4cplus_loglevel_t loglevel_t
Definition: clogger.h:48
LOG4CPLUS_EXPORT int log4cplus_file_configure(const log4cplus_char_t *pathname)
LOG4CPLUS_EXPORT int log4cplus_file_reconfigure(const log4cplus_char_t *pathname)
LOG4CPLUS_EXPORT int log4cplus_logger_is_enabled_for(const log4cplus_char_t *name, log4cplus_loglevel_t ll)
LOG4CPLUS_EXPORT int log4cplus_str_reconfigure(const log4cplus_char_t *config)
LOG4CPLUS_EXPORT int log4cplus_basic_configure(void)
LOG4CPLUS_EXPORT int log4cplus_add_callback_appender(const log4cplus_char_t *logger, log4cplus_log_event_callback_t callback, void *cookie)
void(* log4cplus_log_event_callback_t)(void *cookie, log4cplus_char_t const *message, log4cplus_char_t const *loggerName, log4cplus_loglevel_t ll, log4cplus_char_t const *thread, log4cplus_char_t const *thread2, unsigned long long timestamp_secs, unsigned long timestamp_usecs, log4cplus_char_t const *file, log4cplus_char_t const *function, int line)
CallbackAppender callback type.
Definition: clogger.h:105
void * log4cplus_logger_t
Definition: clogger.h:44
LOG4CPLUS_EXPORT int log4cplus_add_log_level(unsigned int ll, const log4cplus_char_t *ll_name)
LOG4CPLUS_EXPORT int LOG4CPLUS_EXPORT int log4cplus_logger_log_str(const log4cplus_char_t *name, log4cplus_loglevel_t ll, const log4cplus_char_t *msg)
char log4cplus_char_t
Definition: clogger.h:63
LOG4CPLUS_EXPORT void * log4cplus_initialize(void)
log4cplus_logger_t logger_t
Definition: clogger.h:45
LOG4CPLUS_EXPORT int log4cplus_remove_log_level(unsigned int ll, const log4cplus_char_t *ll_name)
LOG4CPLUS_EXPORT void log4cplus_shutdown(void)
LOG4CPLUS_EXPORT int log4cplus_basic_reconfigure(int logToStdErr)
LOG4CPLUS_EXPORT int log4cplus_logger_exists(const log4cplus_char_t *name)
LOG4CPLUS_EXPORT int log4cplus_logger_log(const log4cplus_char_t *name, log4cplus_loglevel_t ll, const log4cplus_char_t *msgfmt,...) LOG4CPLUS_FORMAT_ATTRIBUTE(__printf__
LOG4CPLUS_EXPORT int log4cplus_str_configure(const log4cplus_char_t *config)
LOG4CPLUS_EXPORT int log4cplus_deinitialize(void *initializer)
LOG4CPLUS_EXPORT int log4cplus_logger_force_log(const log4cplus_char_t *name, log4cplus_loglevel_t ll, const log4cplus_char_t *msgfmt,...) LOG4CPLUS_FORMAT_ATTRIBUTE(__printf__
int log4cplus_loglevel_t
Definition: clogger.h:47
LOG4CPLUS_EXPORT int LOG4CPLUS_EXPORT int log4cplus_logger_force_log_str(const log4cplus_char_t *name, log4cplus_loglevel_t ll, const log4cplus_char_t *msg)
#define LOG4CPLUS_FORMAT_ATTRIBUTE(archetype, fmt_index, first_arg_index)
Definition: config.hxx:109
#define LOG4CPLUS_EXPORT
Definition: win32.h:141