#include <stdio.h> /* snprintf */
#include <stdlib.h> /* snprintf */
-#include "src/portable.h" /* to get a working stdarg.h */
+#include "src/portable.h"
#include "src/xbt_modinter.h"
#include "xbt/xbt_os_thread.h"
int xbt_log_no_loc = 0; /* if set to true (with --log=no_loc), file localization will be omitted (for tesh tests) */
-static xbt_os_rmutex_t log_cat_init_mutex = NULL;
+static xbt_os_mutex_t log_cat_init_mutex = NULL;
/** \addtogroup XBT_log
*
xbt_log_default_layout = xbt_log_layout_simple_new(NULL);
_XBT_LOGV(XBT_LOG_ROOT_CAT).appender = xbt_log_default_appender;
_XBT_LOGV(XBT_LOG_ROOT_CAT).layout = xbt_log_default_layout;
- log_cat_init_mutex = xbt_os_rmutex_init();
+ log_cat_init_mutex = xbt_os_mutex_init();
}
static void xbt_log_connect_categories(void)
/* xbt */
XBT_LOG_CONNECT(xbt);
- XBT_LOG_CONNECT(graphxml_parse);
XBT_LOG_CONNECT(log);
XBT_LOG_CONNECT(module);
- XBT_LOG_CONNECT(peer);
XBT_LOG_CONNECT(replay);
XBT_LOG_CONNECT(strbuff);
XBT_LOG_CONNECT(xbt_cfg);
XBT_LOG_CONNECT(xbt_dict);
XBT_LOG_CONNECT(xbt_dict_cursor);
XBT_LOG_CONNECT(xbt_dict_elm);
-#ifdef XBT_USE_DEPRECATED
- XBT_LOG_CONNECT(xbt_dict_multi);
-#endif
XBT_LOG_CONNECT(xbt_dyn);
XBT_LOG_CONNECT(xbt_ex);
XBT_LOG_CONNECT(xbt_fifo);
XBT_LOG_CONNECT(xbt_mallocator);
XBT_LOG_CONNECT(xbt_matrix);
XBT_LOG_CONNECT(xbt_parmap);
- XBT_LOG_CONNECT(xbt_queue);
- XBT_LOG_CONNECT(xbt_set);
XBT_LOG_CONNECT(xbt_sync);
XBT_LOG_CONNECT(xbt_sync_os);
/* bindings */
#ifdef HAVE_LUA
- XBT_LOG_CONNECT(bindings);
XBT_LOG_CONNECT(lua);
XBT_LOG_CONNECT(lua_host);
XBT_LOG_CONNECT(lua_platf);
- XBT_LOG_CONNECT(lua_utils);
+ XBT_LOG_CONNECT(lua_debug);
#endif
/* instr */
XBT_LOG_CONNECT(instr_paje_values);
XBT_LOG_CONNECT(instr_resource);
XBT_LOG_CONNECT(instr_routing);
- XBT_LOG_CONNECT(instr_sd);
XBT_LOG_CONNECT(instr_surf);
XBT_LOG_CONNECT(instr_trace);
XBT_LOG_CONNECT(instr_TI_trace);
XBT_LOG_CONNECT(msg_synchro);
XBT_LOG_CONNECT(msg_task);
XBT_LOG_CONNECT(msg_vm);
-
+
+ /* sg */
+ XBT_LOG_CONNECT(sg_host);
+
/* simdag */
XBT_LOG_CONNECT(sd);
XBT_LOG_CONNECT(sd_daxparse);
#endif
XBT_LOG_CONNECT(sd_kernel);
XBT_LOG_CONNECT(sd_task);
- XBT_LOG_CONNECT(sd_workstation);
/* simix */
XBT_LOG_CONNECT(simix);
/* surf */
XBT_LOG_CONNECT(surf);
- XBT_LOG_CONNECT(platf_generator);
- XBT_LOG_CONNECT(random);
XBT_LOG_CONNECT(surf_config);
XBT_LOG_CONNECT(surf_cpu);
XBT_LOG_CONNECT(surf_cpu_cas);
void xbt_log_postexit(void)
{
XBT_VERB("Exiting log");
- xbt_os_rmutex_destroy(log_cat_init_mutex);
+ xbt_os_mutex_destroy(log_cat_init_mutex);
xbt_dynar_free(&xbt_log_settings);
log_cat_exit(&_XBT_LOGV(XBT_LOG_ROOT_CAT));
}
if (setting->fmt) {
xbt_log_layout_set(category, xbt_log_layout_format_new(setting->fmt));
- XBT_DEBUG("Apply settings for category '%s': set format to %s",
- category->name, setting->fmt);
+ XBT_DEBUG("Apply settings for category '%s': set format to %s", category->name, setting->fmt);
}
if (setting->additivity != -1) {
{
#define _xbt_log_cat_init(a, b) (0)
- if (log_cat_init_mutex != NULL) {
- xbt_os_rmutex_acquire(log_cat_init_mutex);
- }
+ if (log_cat_init_mutex != NULL)
+ xbt_os_mutex_acquire(log_cat_init_mutex);
if (category->initialized) {
- if (log_cat_init_mutex != NULL) {
- xbt_os_rmutex_release(log_cat_init_mutex);
- }
+ if (log_cat_init_mutex != NULL)
+ xbt_os_mutex_release(log_cat_init_mutex);
return priority >= category->threshold;
}
}
category->initialized = 1;
- if (log_cat_init_mutex != NULL) {
- xbt_os_rmutex_release(log_cat_init_mutex);
- }
+ if (log_cat_init_mutex != NULL)
+ xbt_os_mutex_release(log_cat_init_mutex);
return priority >= category->threshold;
#undef _xbt_log_cat_init
dot = control_string;
control_string += strcspn(control_string, ":= ");
eq = control_string;
- control_string += strcspn(control_string, " ");
if(*dot != '.' && (*eq == '=' || *eq == ':'))
xbt_die ("Invalid control string '%s'", orig_control_string);
if(i<XBT_LOG_STATIC_THRESHOLD){
fprintf(stderr,
- "Priority '%s' (in setting '%s') is above allowed priority '%s'.\n\n"
- "Compiling SimGrid with -DNDEBUG forbids the levels 'trace' and 'debug'\n"
- "while -DNLOG forbids any logging, at any level.",
+ "Priority '%s' (in setting '%s') is above allowed priority '%s'.\n\n"
+ "Compiling SimGrid with -DNDEBUG forbids the levels 'trace' and 'debug'\n"
+ "while -DNLOG forbids any logging, at any level.",
eq + 1, name, xbt_log_priority_names[XBT_LOG_STATIC_THRESHOLD]);
exit(1);
}else if (i < xbt_log_priority_infinite) {
if (!strncmp(neweq, "file:", 5)) {
set->appender = xbt_log_appender_file_new(neweq + 5);
}else if (!strncmp(neweq, "rollfile:", 9)) {
- set->appender = xbt_log_appender2_file_new(neweq + 9,1);
+ set->appender = xbt_log_appender2_file_new(neweq + 9,1);
}else if (!strncmp(neweq, "splitfile:", 10)) {
- set->appender = xbt_log_appender2_file_new(neweq + 10,0);
+ set->appender = xbt_log_appender2_file_new(neweq + 10,0);
} else {
THROWF(arg_error, 0, "Unknown appender log type: '%s'", neweq);
}