#include "xbt/dynar.h"
XBT_PUBLIC_DATA(int) (*xbt_pid) ();
-int xbt_log_no_loc = 0; /* if set to true (with --log=no_loc), file localization will be omitted (for tesh tests) */
+int xbt_log_no_loc = 0; /* if set to true (with --log=no_loc), file localization will be omitted (for tesh tests) */
/** \addtogroup XBT_log
*
welcome here, too.
- *//*' */
+ *//*' */
xbt_log_appender_t xbt_log_default_appender = NULL; /* set in log_init */
s_xbt_log_category_t _XBT_LOGV(XBT_LOG_ROOT_CAT) = {
NULL /*parent */ , NULL /* firstChild */ , NULL /* nextSibling */ ,
- "root", xbt_log_priority_uninitialized /* threshold */ ,
- 0 /* isThreshInherited */ ,
- NULL /* appender */ , NULL /* layout */ ,
- 0 /* additivity */
+ "root", xbt_log_priority_uninitialized /* threshold */ ,
+ 0 /* isThreshInherited */ ,
+ NULL /* appender */ , NULL /* layout */ ,
+ 0 /* additivity */
};
XBT_LOG_NEW_CATEGORY(xbt, "All XBT categories (simgrid toolbox)");
/* create the default appender and install it in the root category,
which were already created (damnit. Too slow little beetle) */
-void xbt_log_preinit(void) {
+void xbt_log_preinit(void)
+{
xbt_log_default_appender = xbt_log_appender_file_new(NULL);
xbt_log_default_layout = xbt_log_layout_simple_new(NULL);
_XBT_LOGV(XBT_LOG_ROOT_CAT).appender = xbt_log_default_appender;
*
* xbt_log_control_set() is called on each string we got from cmd line
*/
-void xbt_log_init(int *argc, char **argv) {
+void xbt_log_init(int *argc, char **argv)
+{
int i, j;
char *opt;
if (strncmp(argv[i], "--log=", strlen("--log=")))
WARN2
- ("Option %.*s is deprecated and will disapear in the future. Use --log instead.",
- (int) (strchr(argv[i], '=') - argv[i]), argv[i]);
+ ("Option %.*s is deprecated and will disapear in the future. Use --log instead.",
+ (int) (strchr(argv[i], '=') - argv[i]), argv[i]);
opt = strchr(argv[i], '=');
opt++;
DEBUG2("Set %p as appender of category '%s'",
setting->appender, category->name);
}
-
#undef _xbt_log_cat_init
}
DEBUG3("Set %s (%s) as father of %s ",
category->parent->name,
(category->parent->threshold == xbt_log_priority_uninitialized ?
- "uninited" : xbt_log_priority_names[category->parent->threshold]),
+ "uninited" : xbt_log_priority_names[category->
+ parent->threshold]),
category->name);
xbt_log_parent_set(category, category->parent);
if (parent->threshold == xbt_log_priority_uninitialized) {
- _xbt_log_cat_init(parent, xbt_log_priority_uninitialized /* ignored */ );
+ _xbt_log_cat_init(parent,
+ xbt_log_priority_uninitialized /* ignored */ );
}
cat->threshold = parent->threshold;
*p -= 'a' - 'A';
}
}
- if (!strcmp(neweq, "ON") || !strcmp(neweq, "YES") || !strcmp(neweq, "1")) {
+ if (!strcmp(neweq, "ON") || !strcmp(neweq, "YES")
+ || !strcmp(neweq, "1")) {
set->additivity = 1;
} else {
set->additivity = 0;
} else {
char buff[512];
snprintf(buff, min(512, eq - dot), "%s", dot + 1);
- THROW1(arg_error, 0, "Unknown setting of the log category: '%s'", buff);
+ THROW1(arg_error, 0, "Unknown setting of the log category: '%s'",
+ buff);
}
set->catname = (char *) xbt_malloc(dot - name + 1);
DEBUG1("Parse log settings '%s'", control_string);
/* Special handling of no_loc request, which asks for any file localization to be omitted (for tesh runs) */
- if (!strcmp(control_string,"no_loc")) {
- xbt_log_no_loc=1;
+ if (!strcmp(control_string, "no_loc")) {
+ xbt_log_no_loc = 1;
return;
}
/* some initialization if this is the first time that this get called */
xbt_log_category_t cat = NULL;
set = _xbt_log_parse_setting(str);
- cat = _xbt_log_cat_searchsub(&_XBT_LOGV(XBT_LOG_ROOT_CAT), set->catname);
+ cat =
+ _xbt_log_cat_searchsub(&_XBT_LOGV(XBT_LOG_ROOT_CAT), set->catname);
if (cat) {
DEBUG0("Apply directly");
void xbt_log_layout_set(xbt_log_category_t cat, xbt_log_layout_t lay)
{
if (!cat->appender) {
- VERB1("No appender to category %s. Setting the file appender as default",
- cat->name);
+ VERB1
+ ("No appender to category %s. Setting the file appender as default",
+ cat->name);
xbt_log_appender_set(cat, xbt_log_appender_file_new(NULL));
}
if (cat->layout && cat != &_XBT_LOGV(root)) {