Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Kill old $Id$ command dating from CVS
[simgrid.git] / testsuite / xbt / log_usage.c
1 /* log_usage - A test of normal usage of the log facilities                 */
2
3 /* Copyright (c) 2003, 2004 Martin Quinson. All rights reserved.            */
4
5 /* This program is free software; you can redistribute it and/or modify it
6  * under the terms of the license (GNU LGPL) which comes with this package. */
7
8 #ifdef __BORLANDC__
9 #pragma hdrstop
10 #endif
11
12 #include "gras.h"
13
14
15
16 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(test, top, "Logging specific to this test");
17 XBT_LOG_NEW_CATEGORY(top, "Useless test channel");
18
19 #ifdef __BORLANDC__
20 #pragma argsused
21 #endif
22
23 static void dolog(const char *settings)
24 {
25   INFO1("Test with the settings '%s'", settings);
26   xbt_log_control_set(settings);
27   DEBUG1("val=%d", 1);
28   WARN1("val=%d", 2);
29   CDEBUG2(top, "val=%d%s", 3, "!");
30   CRITICAL6("false alarm%s%s%s%s%s%s", "", "", "", "", "", "!");
31 }
32
33
34 int main(int argc, char **argv)
35 {
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 }