emu_log.h
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
00022
00023
00024
00025
00026
00027
00028 #ifndef HAVE_EMU_LOG_H
00029 #define HAVE_EMU_LOG_H
00030
00031 struct emu;
00032
00033 enum emu_log_level
00034 {
00035 EMU_LOG_NONE,
00036 EMU_LOG_INFO,
00037 EMU_LOG_DEBUG
00038 };
00039
00040 typedef void (*emu_log_logcb)(struct emu *e, enum emu_log_level level, const char *msg);
00041
00042 struct emu_logging *emu_log_new(void);
00043 void emu_log_free(struct emu_logging *el);
00044
00045 void emu_log_level_set(struct emu_logging *el, enum emu_log_level level);
00046
00047 void emu_log(struct emu *e, enum emu_log_level level, const char *format, ...);
00048
00049 void emu_log_set_logcb(struct emu_logging *el, emu_log_logcb logcb);
00050
00051 void emu_log_default_logcb(struct emu *e, enum emu_log_level level, const char *msg);
00052
00053 #define logInfo(e, format...) emu_log(e, EMU_LOG_INFO, format)
00054
00055 #ifdef DEBUG
00056 #define logDebug(e, format...) emu_log(e, EMU_LOG_DEBUG, format)
00057 #else
00058 #define logDebug(e, format...)
00059 #endif // DEBUG
00060
00061 #define logPF(e) logDebug(e, "in <%s> %s:%i>\n", __PRETTY_FUNCTION__, __FILE__, __LINE__)
00062
00063 #endif // HAVE_EMU_LOG_H