]> AND Public Git Repository - simgrid.git/blobdiff - testsuite/xbt/log_usage.c
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
alpha portability again (damn size_t)
[simgrid.git] / testsuite / xbt / log_usage.c
index 3a6f8644d6eb66cbf774075c3065479c4ee95bb4..5155fd9b72560c1d2ee587568422746e56805eab 100644 (file)
 #include <gras.h>
 #include <stdio.h>
 
-GRAS_LOG_NEW_DEFAULT_SUBCATEGORY(Test, Top);
-GRAS_LOG_NEW_CATEGORY(Top);
+GRAS_LOG_NEW_DEFAULT_SUBCATEGORY(test, top,"Logging specific to this test");
+GRAS_LOG_NEW_CATEGORY(top,"Useless test channel");
 
-int main(int ac, char **av) {
-  gras_error_t errcode;
+int main(int argc, char **argv) {
+  gras_init_defaultlog(&argc,argv,"root.thresh=debug log.thresh=debug");
 
-  if (ac > 1) {
-    TRYFAIL(gras_log_control_set(av[1]));
-  } else {
-    TRYFAIL(gras_log_control_set("root.thresh=debug log.thresh=debug"));
-  }
   DEBUG1("val=%d", 1);
-  WARNING1("val=%d", 2);
-  CDEBUG2(Top, "val=%d%s", 3, "!");
+  WARN1("val=%d", 2);
+  CDEBUG2(top, "val=%d%s", 3, "!");
   CRITICAL6("false alarm%s%s%s%s%s%s", "","","","","","!");
   
+  gras_exit();
   return 0;
 }