-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.c
More file actions
36 lines (26 loc) · 920 Bytes
/
Copy pathexample.c
File metadata and controls
36 lines (26 loc) · 920 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#define SOLOG_IMPLEMENTATION SOLOG_FEATURE_ALL
#include "solog.h"
static int hello( void )
{
puts( "Hello." );
return 0;
}
int main( void )
{
SOLOG( INFO, "Entering '%s'. This logs to stderr (default).", __func__ );
solog_config.stream = stdout;
SOLOG( INFO, "This logs to stdout." );
solog_config.level = SOLOG_LVL_WARN;
SOLOG( INFO, "This does not log at all as it is below the current warning level."
"It also does not say 'Hello' as arguments are only evaluated "
"if there is an actual message being logged.", hello() );
puts( "" );
solog_config.level = SOLOG_LVL_TRACE;
SOLOG( TRACE, "Example TRACE message" );
SOLOG( DEBUG, "Example Debug message" );
SOLOG( INFO, "Example INFO message" );
SOLOG( WARN, "Example WARN message" );
SOLOG( ERR, "Example ERR message" );
SOLOG( FAIL, "Example FAIL message" );
return 0;
}