Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00031 #ifndef EUREPHIA_LOG_H_
00032 #define EUREPHIA_LOG_H_
00033
00034 #include <eurephia_log_struct.h>
00035 #include <eurephia_context.h>
00036
00037 #ifdef ENABLE_DEBUG
00038 #warning ###### DEBUG LOGGING IS ENABLED - THIS COULD BE A SECURITY ISSUE ######
00039
00044 #define DEBUG(ctx, log_level, log_string...) _eurephia_log_func(ctx, LOG_DEBUG, log_level, __FILE__, __LINE__, ## log_string);
00045 #else
00046 #define DEBUG(ctx, lvl, rest...) {};
00047 #endif
00048
00049 #ifdef SHOW_SECRETS
00050 #warning ##########################################################################################
00051 #warning ## ##
00052 #warning ## DEBUG LOGGING WITH SHOW_SECRETS IS ENABLED - THIS WILL LOG PASSWORDS IN CLEAR TEXT ##
00053 #warning ## ##
00054 #warning ##########################################################################################
00055 #endif
00056
00057 int eurephia_log_init(eurephiaCTX *ctx, const char *ident, const char *dest, int loglvl);
00058 void eurephia_log_close(eurephiaCTX *ctx);
00059
00069 #define eurephia_log(ctx, dst, lvl, log_string...) _eurephia_log_func(ctx, dst, lvl, __FILE__, __LINE__, ## log_string)
00070 void _eurephia_log_func(eurephiaCTX *ctx, int logdst, int loglvl, const char *file, int line,
00071 const char *fmt, ... );
00072 #endif