Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
I'm a testing freak, I know
[simgrid.git] / testsuite / xbt / log_usage.c
1 /* $Id$ */
2
3 /* log_usage - A test of normal usage of the log facilities                 */
4
5 /* Copyright (c) 2003, 2004 Martin Quinson. All rights reserved.            */
6
7 /* This program is free software; you can redistribute it and/or modify it
8  * under the terms of the license (GNU LGPL) which comes with this package. */
9  
10 #ifdef __BORLANDC__
11 #pragma hdrstop
12 #endif
13
14 #include "gras.h"
15
16
17
18 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(test, top,"Logging specific to this test");
19 XBT_LOG_NEW_CATEGORY(top,"Useless test channel");
20
21 #ifdef __BORLANDC__
22 #pragma argsused
23 #endif
24
25 static void dolog(const char *settings) {
26   INFO1("Test with the settings '%s'",settings);
27   xbt_log_control_set(settings);
28   DEBUG1("val=%d", 1);
29   WARN1("val=%d", 2);
30   CDEBUG2(top, "val=%d%s", 3, "!");
31   CRITICAL6("false alarm%s%s%s%s%s%s", "","","","","","!");   
32 }
33
34
35 int main(int argc, char **argv) {
36   xbt_init(&argc,argv);
37
38   dolog("");
39   dolog(" ");
40   dolog(" test.thres:info root.thres:info  ");
41   dolog(" test.thres:debug ");
42   dolog(" test.thres:verbose root.thres:error ");
43   dolog(" test.thres:critical ");
44   
45   xbt_exit();
46   return 0;
47 }