Revision 507372bb tests/log/logtest.c

View differences:

tests/log/logtest.c
1 1
/*
2
 * Log test and demo application for the logging facilities of the GRAPES framework.
2
 * Log test and demo application for the logging facilities of the NAPA framework.
3 3
 *
4
 * There are 2 ways of calling grapes_log:
5
 * 	- grapes_log(SEVERITY, format, args...)
4
 * There are 2 ways of calling napa_log:
5
 * 	- napa_log(SEVERITY, format, args...)
6 6
 *	- or use one of the convenience macros like debug(format, args...) or info(format, args...) as shown below.
7 7
 *
8 8
 */
9 9

  
10
#include	<grapes_log.h>		/* You must include grapes_log.h in order to use grapes logging */
10
#include	<napa_log.h>		/* You must include napa_log.h in order to use napa logging */
11 11

  
12 12
#include	<math.h>		/* This one is just for fun */
13 13

  
14 14
int main(int argc, char *argv) {
15 15

  
16
	grapes_log(LOG_INFO, "You won't see this as logging is not initialized");
16
	napa_log(LOG_INFO, "You won't see this as logging is not initialized");
17 17

  
18 18
	/* Initialize logging */
19
	grapesInitLog(-1, NULL, NULL);
19
	napaInitLog(-1, NULL, NULL);
20 20

  
21
	grapes_log(LOG_WARN,"Warning! Here I come!");
21
	napa_log(LOG_WARN,"Warning! Here I come!");
22 22

  
23
	grapes_log(LOG_INFO,"Hey! This is my %dst %s message", 1, "INFO");
23
	napa_log(LOG_INFO,"Hey! This is my %dst %s message", 1, "INFO");
24 24
	info("And here comes the %dnd, just much simpler", 2);
25 25

  
26 26
	error("And this is an error message");	
27 27

  
28
	grapesCloseLog();
28
	napaCloseLog();
29 29

  
30 30
	info("Invisible again, as logging is closed");
31 31

  
32
	grapesInitLog(-1, NULL, NULL);
32
	napaInitLog(-1, NULL, NULL);
33 33

  
34 34
	debug("Next, I'm going to fatally die...");
35 35

  

Also available in: Unified diff