Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid
[simgrid.git] / teshsuite / xbt / log_usage / log_usage.c
1 /* log_usage - A test of normal usage of the log facilities                 */
2
3 /* Copyright (c) 2004-2007, 2009-2015. 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 #include "xbt.h"
10
11 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(test, top, "Logging specific to this test");
12 XBT_LOG_NEW_CATEGORY(top, "Useless test channel");
13
14 static void dolog(const char *settings)
15 {
16   XBT_INFO("Test with the settings '%s'", settings);
17   xbt_log_control_set(settings);
18   XBT_DEBUG("val=%d", 1);
19   XBT_WARN("val=%d", 2);
20   XBT_CDEBUG(top, "val=%d%s", 3, "!");
21   XBT_CRITICAL("false alarm%s%s%s%s%s%s", "", "", "", "", "", "!");
22 }
23
24 int main(int argc, char **argv)
25 {
26   xbt_init(&argc, argv);
27
28   dolog("");
29   dolog(" ");
30   dolog(" test.thres:info root.thres:info  ");
31 #ifndef NDEBUG
32   dolog(" test.thres:debug ");
33 #endif
34   dolog(" test.thres:verbose root.thres:error ");
35   dolog(" test.thres:critical ");
36
37   return 0;
38 }