-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4806b3c
commit 78d68ee
Showing
27 changed files
with
394 additions
and
262 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
��Դ��C��־������iLOG3�������ţ��ߡ�һ������Ӧ���ڶ����־�ļ��� | ||
|
||
���������ţ������ڿ���һ�����߳�ģ�͵�Ӧ�÷���ƽ̨�����ǵ�iLOG3������������ܶ�������������Ϊƽ̨��־ģ�飬��������ÿ���̸߳��ݲ�ͬ�Ľ����������־����ͬ���ļ�����һ�������ļ�ʵ�ֲ��ˡ����ǣ�����ҹ���俪����������������Դ�����ijɳ��������������ʵ�ֵĿ��ٵ�������� | ||
|
||
ʵ��ԭ���ܼ��ṩһ���ӿ�����־����ڵ���־�ļ������ɡ�����һ������ | ||
|
||
�����ļ����� | ||
log.conf | ||
[code] | ||
id hello | ||
output FILE $HOME$/log/parent.log | ||
level INFO | ||
styles DATETIME|LOGLEVEL|PID|TID|SOURCE|FORMAT|NEWLINE | ||
options CHANGE_TEST | ||
rotate_mode SIZE | ||
rotate_size 10MB | ||
log_bufsize 1MB 5MB | ||
[/code] | ||
|
||
���̶߳�ȡ�����ļ���������־��� | ||
[code=c] | ||
CreateLogHandleFromConfigG( "log.conf" , NULL ) ; | ||
[/code] | ||
���߳�д�Ķ���$HOME$/log/parent.log | ||
|
||
���յ��½������̴߳��������̼̳߳и��̵߳���־����������̱߳��ش洢��ȱʡȫ����־������߳�֮���ǰ�ȫ�ģ���ֻ�����־�ļ����ĵ����ɣ�ʹ����־������ͺ�LOG_OUTPUT_NOSET����ֱ������־�ļ��� | ||
[code=c] | ||
char pathfilename[ MAXLEN_FILENAME + 1 ] ; | ||
memset( pathfilename , 0x00 , sizeof(pathfilename) ); | ||
snprintf( pathfilename , sizeof(pathfilename)-1 , "$HOME$/log/child_%s.log" , transaction_code ); /* transaction_code�Ǵӱ�������ȡ�����Ľ����� */ | ||
SetLogOutputG( LOG_OUTPUT_NOSET , pathfilename , LOG_NO_OUTPUTFUNC ); /* ֱ������־����ڵ���־�ļ���������ļ��Ѵ����ȹر�֮ */ | ||
[/code] | ||
���߳�д�Ķ���$HOME$/log/child_(������).log | ||
|
||
������䣬����ʹ���̻߳����̶�ȡһ�������ļ�����˵�̳�һ����־�����������Ҫ�����ͬ����־�ļ���������Ҫ��д��������ļ�������ظ�������־����������ĵ�Ч���ܡ� | ||
|
||
����ֱ�ӵ��ú������������ļ���ʽʹ����־�����ʵ���������ⷽ�����ơ� | ||
|
||
��־������iLOG3�������Ľṹ��ܡ�����ʹ�÷��������ڵĶ�����չ�����Լ�����������������ڱ�Խ��Խ�����ʹ�ã����������л��ҵ����� ^_^ | ||
�Dz���Խ��Խ�Ķ��ˣ��ǾϽ������������ | ||
��ҳ������ : [url]http://git.oschina.net/calvinwilliams/iLOG3[/url] | ||
Դ�����docĿ¼�а������û�ָ�ϺͲο��ֲᣬ�����и��꾡��˵�� |
Oops, something went wrong.