Yder
Logging library written in C
Loading...
Searching...
No Matches
yder.h
Go to the documentation of this file.
1
27#ifndef __YDER_H__
28#define __YDER_H__
29
30#ifdef __cplusplus
31extern "C"
32{
33#endif
34
35#include "yder-cfg.h"
36
37#include <time.h>
38
44#define Y_LOG_MODE_NONE 0x00000000
45#define Y_LOG_MODE_CONSOLE 0x000000F0
46#define Y_LOG_MODE_SYSLOG 0x00000F00
47#define Y_LOG_MODE_FILE 0x0000F000
48#define Y_LOG_MODE_JOURNALD 0x000F0000
49#define Y_LOG_MODE_CALLBACK 0x00F00000
50#define Y_LOG_MODE_CURRENT 0xFFFFFFFF
51
52#define Y_LOG_LEVEL_NONE 0x0000
53#define Y_LOG_LEVEL_ERROR 0x000F
54#define Y_LOG_LEVEL_WARNING 0x00F0
55#define Y_LOG_LEVEL_INFO 0x0F00
56#define Y_LOG_LEVEL_DEBUG 0xF000
57#define Y_LOG_LEVEL_CURRENT 0xFFFF
58
59#define Y_SPLIT_CURRENT -1
81int y_init_logs(const char * app, const unsigned long init_mode, const unsigned long init_level, const char * init_log_file, const char * message);
82
91int y_set_logs_callback(void (* y_callback_log_message) (void * cls, const char * app_name, const time_t date, const unsigned long level, const char * message),
92 void * cls,
93 const char * message);
94
102int y_set_date_format(const char * format, const char * message);
103
113int y_set_split_message_newline(int split, const char * message);
114
119int y_close_logs(void);
120
136void y_log_message(const unsigned long type, const char * message, ...);
137
142#ifdef __cplusplus
143}
144#endif
145
146#endif // __YDER_H__
int y_set_split_message_newline(int split, const char *message)
Definition yder.c:389
int y_set_logs_callback(void(*y_callback_log_message)(void *cls, const char *app_name, const time_t date, const unsigned long level, const char *message), void *cls, const char *message)
Definition yder.c:371
int y_init_logs(const char *app, const unsigned long init_mode, const unsigned long init_level, const char *init_log_file, const char *message)
Definition yder.c:353
int y_set_date_format(const char *format, const char *message)
Definition yder.c:381
int y_close_logs(void)
Definition yder.c:393
void y_log_message(const unsigned long type, const char *message,...)
Definition yder.c:397