Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Let xbt_exit() issue a warning stating that this is now a no-op
[simgrid.git] / testsuite / xbt / log_usage.c
1 /* log_usage - A test of normal usage of the log facilities                 */
2
3 /* Copyright (c) 2004, 2005, 2006, 2007, 2009, 2010. The SimGrid Team.
4  * All rights reserved.                                                     */
5
6 /* This program is free software; you can redistribute it and/or modify it
7  * under the terms of the license (GNU LGPL) which comes with this package. */
8
9 #ifdef __BORLANDC__
10 #pragma hdrstop
11 #endif
12
13 #include "gras.h"
14
15
16
17 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(test, top, "Logging specific to this test");
18 XBT_LOG_NEW_CATEGORY(top, "Useless test channel");
19
20 #ifdef __BORLANDC__
21 #pragma argsused
22 #endif
23
24 static void dolog(const char *settings)
25 {
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 {
37   xbt_init(&argc, argv);
38
39   dolog("");
40   dolog(" ");
41   dolog(" test.thres:info root.thres:info  ");
42   dolog(" test.thres:debug ");
43   dolog(" test.thres:verbose root.thres:error ");
44   dolog(" test.thres:critical ");
45
46   return 0;
47 }