+#include "portable.h"
+
+extern const char *xbt_log_priority_names[8];
+extern int xbt_log_no_loc;
+
+static double simple_begin_of_time = -1;
+
+#define XBT_LOG_BUFF_SIZE (ev->buffer_size)
+
+/* only used after the format using: we suppose that the buffer is big enough to display our data */
+#undef check_overflow
+#define check_overflow \
+ if (p - ev->buffer >= XBT_LOG_BUFF_SIZE) { /* buffer overflow */ \
+ return 0; \
+ } else ((void)0)
+
+static int xbt_log_layout_simple_doit(xbt_log_layout_t l,
+ xbt_log_event_t ev,
+ const char *fmt)
+{
+ char *p;
+ const char *procname = NULL;
+ xbt_assert(ev->priority >= 0,
+ "Negative logging priority naturally forbidden");
+ xbt_assert(ev->priority < sizeof(xbt_log_priority_names),
+ "Priority %d is greater than the biggest allowed value",
+ ev->priority);
+
+ p = ev->buffer;
+ p += snprintf(p, XBT_LOG_BUFF_SIZE - (p - ev->buffer), "[");
+ check_overflow;