StRoot
1
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Groups
Pages
RTS
src
LOG
logTest.C
1
// This snippet is used for testing the log to the localhost
2
#include <stdio.h>
3
#include <stdlib.h>
4
5
#include <rtsLog.h>
6
7
int
main(
int
argc,
char
*argv[])
8
{
9
int
port ;
10
const
char
*dest ;
11
int
i ;
12
13
if
(argc == 1) {
14
port = 8006 ;
15
dest =
"172.16.0.1"
;
16
}
17
else
{
18
port = atoi(argv[1]) ;
19
dest = RTS_LOG_HOST ;
20
}
21
22
23
24
printf(
"Default destination is -%s-, port %d\n"
,RTS_LOG_HOST,RTS_LOG_PORT) ;
25
26
rtsLogLevel(DBG) ;
27
rtsLogAddDest(dest,port) ;
28
printf(
"Destination -%s-, port %d\n"
,dest,port) ;
29
30
for
(i=0;i<10000;i++) {
31
LOG(DBG,
"Testing log facility %u"
,i) ;
32
}
33
34
LOG(WARN,
"This should be warning..."
,0,0,0,0,0) ;
35
LOG(CRIT,
"This is really critical..."
,0,0,0,0,0) ;
36
37
return
0 ;
38
}
39
Generated by
1.8.5