Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Change interface for elements_father, and avoid to allocate a dynar.
[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,
18                                 "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 {
27   XBT_INFO("Test with the settings '%s'", settings);
28   xbt_log_control_set(settings);
29   XBT_DEBUG("val=%d", 1);
30   XBT_WARN("val=%d", 2);
31   XBT_CDEBUG(top, "val=%d%s", 3, "!");
32   XBT_CRITICAL("false alarm%s%s%s%s%s%s", "", "", "", "", "", "!");
33 }
34
35
36 int main(int argc, char **argv)
37 {
38   xbt_init(&argc, argv);
39
40   dolog("");
41   dolog(" ");
42   dolog(" test.thres:info root.thres:info  ");
43   dolog(" test.thres:debug ");
44   dolog(" test.thres:verbose root.thres:error ");
45   dolog(" test.thres:critical ");
46
47   return 0;
48 }