代码拉取完成,页面将自动刷新
#ifndef _ILOG_H_
#define _ILOG_H_
#define _THREADLOG_ //定义是否用于多线程
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <errno.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <stdarg.h>
#include <fcntl.h>
#include <sys/time.h>
#include <unistd.h>
#define ulong unsigned long
#define uint unsigned int
#if ( defined _THREADLOG_ )
#include <pthread.h>
#define TLS __thread
#else
#define TLS
#endif
#define LOGFILEMAXLEN 1024
#define LOGBUFLEN 2048
#define LOGFILENAMEMAXLEN 1024
#define LOGDEFAULTLEVEL LOG_LEVEL_INFO
#define LOG_LEVEL_DEBUG 0
#define LOG_LEVEL_WARN 1
#define LOG_LEVEL_INFO 2
#define LOG_LEVEL_ERROR 3
#define LOG_LEVEL_FATAL 4
#define PROCESSID getpid()
#define THREADID pthread_self()
#define ADDNEWLINE( __buf__, __usedlen__, __remainlen__ ) \
sprintf(__buf__, "\n"); \
__buf__++; \
__usedlen__++; \
__remainlen__--
int SetLogFile( char *format, ...);
int SetLogLevel( int loglevel );
/* 输入到文件的接口 */
int FatalLog( char *filename, ulong fileline, char *format, ...);
int ErrorLog( char *filename, ulong fileline, char *format, ...);
int InfoLog( char *filename, ulong fileline, char *format, ...);
int DebugLog( char *filename, ulong fileline, char *format, ...);
int WarnLog( char *filename, ulong fileline, char *format, ...);
typedef struct
{
char PathFielTemplate[LOGFILEMAXLEN + 1];
char PathFileName[LOGFILENAMEMAXLEN + 1];
char MsgBuf[LOGBUFLEN + 1];
char MsgTemplate[LOGBUFLEN + 1];
int LogLevel;
}LogEnv;
#endif
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。