}
va_start(ev->ap, fmt);
+ va_start(ev->ap_copy, fmt);
while(1) {
xbt_log_appender_t appender = cat->appender;
if (appender != NULL) {
xbt_assert1(cat->layout,"No valid layout for the appender of category %s",cat->name);
- cat->layout->do_layout(cat->layout, ev, fmt);
- appender->do_append(appender, ev->buffer);
+ cat->layout->do_layout(cat->layout, ev, fmt, appender);
}
if (!cat->additivity)
break;
cat = cat->parent;
}
va_end(ev->ap);
+ va_end(ev->ap_copy);
}
static void _xbt_log_cat_apply_set(xbt_log_category_t category,
struct xbt_log_layout_s {
void (*do_layout)(xbt_log_layout_t l,
- xbt_log_event_t event, const char *fmt);
+ xbt_log_event_t event, const char *fmt,
+ xbt_log_appender_t appender);
void (*free_) (xbt_log_layout_t l);
void *data;
} ;
#include "portable.h" /* execinfo when available */
#include "xbt/sysdep.h"
+#include "xbt/strbuff.h"
#include "xbt/log_private.h"
#include "gras/virtu.h" /* gras_os_myname (KILLME) */
#include "xbt/synchro.h" /* xbt_thread_self_name */
extern const char *xbt_log_priority_names[7];
-/* Get serious about checking buffer overflows during log construction */
+static double begin_of_time = -1;
+
+#define append1(fmt,fmt2,elm) \
+ do { \
+ if (precision == -1) { \
+ xbt_strbuff_append(buff, tmp=bprintf(fmt,elm)); \
+ free(tmp); \
+ } else { \
+ xbt_strbuff_append(buff, tmp=bprintf(fmt2,precision,elm)); \
+ free(tmp); \
+ precision = -1; \
+ } \
+ } while (0)
+#define append2(fmt,elm,elm2) \
+ do { \
+ xbt_strbuff_append(buff, tmp=bprintf(fmt,elm,elm2)); \
+ free(tmp); \
+ precision = -1; \
+ } while (0)
+
+static void xbt_log_layout_format_dynamic(xbt_log_layout_t l,
+ xbt_log_event_t ev,
+ const char*fmt,
+ xbt_log_appender_t app) {
+ xbt_strbuff_t buff = xbt_strbuff_new();
+ int precision=-1;
+ char *q = l->data;
+ char *tmp;
+ char *tmp2;
+
+ while (*q != '\0') {
+ if (*q == '%') {
+ q++;
+ handle_modifier:
+ switch (*q) {
+ case '\0':
+ fprintf(stderr,"Layout format (%s) ending with %%\n",(char*)l->data);
+ abort();
+ case '%':
+ xbt_strbuff_append(buff,"%");
+ break;
+ case 'n': /* platform-dependant line separator (LOG4J compliant) */
+ xbt_strbuff_append(buff,"\n");
+ break;
+ case 'e': /* plain space (SimGrid extension) */
+ xbt_strbuff_append(buff," ");
+ break;
+
+ case '.': /* precision specifyier */
+ q++;
+ q += sscanf(q,"%d",&precision);
+ goto handle_modifier;
+
+ case 'c': /* category name; LOG4J compliant
+ should accept a precision postfix to show the hierarchy */
+ append1("%s","%.*s",ev->cat->name);
+ break;
+ case 'p': /* priority name; LOG4J compliant */
+ append1("%s","%.*s",xbt_log_priority_names[ev->priority]);
+ break;
+
+ case 'h': /* host name; SimGrid extension */
+ append1("%s","%.*s",gras_os_myname());
+ break;
+ case 't': /* thread name; LOG4J compliant */
+ append1("%s","%.*s",xbt_thread_self_name());
+ break;
+ case 'P': /* process name; SimGrid extension */
+ append1("%s","%.*s",xbt_procname());
+ break;
+ case 'i': /* process PID name; SimGrid extension */
+ append1("%d","%.*d",(*xbt_getpid)());
+ break;
+
+ case 'F': /* file name; LOG4J compliant */
+ append1("%s","%.*s",ev->fileName);
+ break;
+ case 'l': /* location; LOG4J compliant */
+ append2("%s:%d",ev->fileName,ev->lineNum);
+ precision = -1; /* Ignored */
+ break;
+ case 'L': /* line number; LOG4J compliant */
+ append1("%d","%.*d",ev->lineNum);
+ break;
+ case 'M': /* method (ie, function) name; LOG4J compliant */
+ append1("%s","%.*s",ev->functionName);
+ break;
+ case 'b': /* backtrace; called %throwable in LOG4J */
+ case 'B': /* short backtrace; called %throwable{short} in LOG4J */
+#if defined(HAVE_EXECINFO_H) && defined(HAVE_POPEN) && defined(ADDR2LINE)
+ {
+ xbt_ex_t e;
+ int i;
+
+ e.used = backtrace((void**)e.bt,XBT_BACKTRACE_SIZE);
+ e.bt_strings = NULL;
+ e.msg=NULL;
+ e.remote=0;
+ xbt_backtrace_current(&e);
+ if (*q=='B') {
+ append1("%s","%.*s",e.bt_strings[2]+8);
+ } else {
+ for (i=2; i<e.used; i++)
+ append1("%s\n","%.*s\n",e.bt_strings[i]+8);
+ }
+
+ xbt_ex_free(e);
+ }
+#else
+ append1("%s","%.*s","(no backtrace on this arch)");
+#endif
+ break;
+
+ case 'd': /* date; LOG4J compliant */
+ append1("%f","%.*f", gras_os_time());
+ break;
+ case 'r': /* application age; LOG4J compliant */
+ append1("%f","%.*f", gras_os_time()-begin_of_time);
+ break;
+
+ case 'm': /* user-provided message; LOG4J compliant */
+ vasprintf(&tmp2, fmt, ev->ap_copy);
+ append1("%s","%.*s",tmp2);
+ free(tmp2);
+ break;
+
+ default:
+ fprintf(stderr,"Unknown %%%c sequence in layout format (%s)\n",
+ *q,(char*)l->data);
+ abort();
+ }
+ q++;
+ } else {
+ char tmp2[2];
+ tmp2[0] = *(q++);
+ tmp2[1] = '\0';
+ xbt_strbuff_append(buff,tmp2);
+ }
+ }
+ app->do_append(app,buff->data);
+ xbt_strbuff_free(buff);
+}
+
#define check_overflow \
if (p-ev->buffer > XBT_LOG_BUFF_SIZE) { /* buffer overflow */ \
- p=ev->buffer + XBT_LOG_BUFF_SIZE - strlen(" >> OUTPUT TRUNCATED <<\n"); \
- p+=sprintf(p," >> OUTPUT TRUNCATED <<\n"); \
+ xbt_log_layout_format_dynamic(l,ev,msg_fmt,app); \
return;\
}
-
static void xbt_log_layout_format_doit(xbt_log_layout_t l,
xbt_log_event_t ev,
- const char *msg_fmt) {
- static double begin_of_time = -1;
+ const char *msg_fmt,
+ xbt_log_appender_t app) {
char *p,*q;
int precision=-1;
}
}
*p = '\0';
+ app->do_append(app,ev->buffer);
}
static void xbt_log_layout_format_free(xbt_log_layout_t lay) {
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "xbt/sysdep.h"
+#include "xbt/strbuff.h" /* For dynamic version when the static one fails */
#include "xbt/log_private.h"
#include "xbt/synchro.h" /* xbt_thread_name */
+
#include "gras/virtu.h"
#include <stdio.h>
#include "portable.h"
extern const char *xbt_log_priority_names[7];
+static double begin_of_time = -1;
+
+static void xbt_log_layout_simple_dynamic(xbt_log_layout_t l,
+ xbt_log_event_t ev,
+ const char*fmt,
+ xbt_log_appender_t app) {
+ xbt_strbuff_t buff = xbt_strbuff_new();
+ char *p;
+
+ /* Put every static information in the static buffer, and copy them in the dyn one */
+ p = ev->buffer;
+ p += snprintf(p,XBT_LOG_BUFF_SIZE-(p-ev->buffer),"[");
+
+ if(strlen(xbt_procname()))
+ p += snprintf(p,XBT_LOG_BUFF_SIZE-(p-ev->buffer),"%s:%s:(%d) ",
+ gras_os_myname(), xbt_procname(),(*xbt_getpid)());
+ p += snprintf(p,XBT_LOG_BUFF_SIZE-(p-ev->buffer),"%f] ", gras_os_time()-begin_of_time);
+ if (ev->priority != xbt_log_priority_info)
+ p += snprintf(p,XBT_LOG_BUFF_SIZE-(p-ev->buffer), "%s:%d: ", ev->fileName, ev->lineNum);
+ p += snprintf(p,XBT_LOG_BUFF_SIZE-(p-ev->buffer), "[%s/%s] ",
+ ev->cat->name, xbt_log_priority_names[ev->priority] );
+
+ xbt_strbuff_append(buff,ev->buffer);
+
+ vasprintf(&p,fmt,ev->ap);
+ xbt_strbuff_append(buff,p);
+ free(p);
+
+ xbt_strbuff_append(buff,"\n");
+
+ app->do_append(app,buff->data);
+ xbt_strbuff_free(buff);
+}
+
/* only used after the format using: we suppose that the buffer is big enough to display our data */
#define check_overflow \
if (p-ev->buffer > XBT_LOG_BUFF_SIZE) { /* buffer overflow */ \
- p=ev->buffer + XBT_LOG_BUFF_SIZE - strlen(" >> OUTPUT TRUNCATED <<\n"); \
- p+=sprintf(p," >> OUTPUT TRUNCATED <<\n"); \
+ xbt_log_layout_simple_dynamic(l,ev,fmt,app); \
+ return; \
}
static void xbt_log_layout_simple_doit(xbt_log_layout_t l,
xbt_log_event_t ev,
- const char *fmt) {
- static double begin_of_time = -1;
+ const char *fmt,
+ xbt_log_appender_t app) {
char *p;
xbt_assert0(ev->priority>=0,
/* End it */
p += snprintf(p,XBT_LOG_BUFF_SIZE-(p-ev->buffer), "\n");
check_overflow;
+ app->do_append(app,ev->buffer);
}
xbt_log_layout_t xbt_log_layout_simple_new(char *arg) {
### XBT tests ###
#################
+ ## Try large logs ##
+ ####################
+
+TESTS += xbt/log_large_test.tesh
+noinst_PROGRAMS += xbt/log_large_test
+xbt_log_large_test_LDADD = $(LDADD_SG)
+
## Try parallel logs ##
#######################
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
-noinst_PROGRAMS = xbt/parallel_log_crashtest$(EXEEXT) \
+noinst_PROGRAMS = xbt/log_large_test$(EXEEXT) \
+ xbt/parallel_log_crashtest$(EXEEXT) \
gras/datadesc/datadesc_usage$(EXEEXT) \
gras/msg_handle/msg_handle_client$(EXEEXT) \
gras/msg_handle/msg_handle_server$(EXEEXT) \
simdag_partask_test_comp_only_seq_OBJECTS = \
$(am_simdag_partask_test_comp_only_seq_OBJECTS)
simdag_partask_test_comp_only_seq_DEPENDENCIES = $(LDADD_SG)
+xbt_log_large_test_SOURCES = xbt/log_large_test.c
+xbt_log_large_test_OBJECTS = log_large_test.$(OBJEXT)
+xbt_log_large_test_DEPENDENCIES = $(LDADD_SG)
xbt_parallel_log_crashtest_SOURCES = xbt/parallel_log_crashtest.c
xbt_parallel_log_crashtest_OBJECTS = parallel_log_crashtest.$(OBJEXT)
xbt_parallel_log_crashtest_DEPENDENCIES = $(LDADD_RL)
$(simdag_network_test_reinit_costs_SOURCES) \
$(simdag_partask_test_comp_only_par_SOURCES) \
$(simdag_partask_test_comp_only_seq_SOURCES) \
- xbt/parallel_log_crashtest.c
+ xbt/log_large_test.c xbt/parallel_log_crashtest.c
DIST_SOURCES = $(gras_datadesc_datadesc_usage_SOURCES) \
$(gras_msg_handle_msg_handle_client_SOURCES) \
$(gras_msg_handle_msg_handle_server_SOURCES) \
$(simdag_network_test_reinit_costs_SOURCES) \
$(simdag_partask_test_comp_only_par_SOURCES) \
$(simdag_partask_test_comp_only_seq_SOURCES) \
- xbt/parallel_log_crashtest.c
+ xbt/log_large_test.c xbt/parallel_log_crashtest.c
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
simdag/partask/platform_2p_1sl_hetero.xml \
simdag/partask/platform_2p_1sl.xml
TESTS_ENVIRONMENT = $(top_builddir)/tools/tesh/tesh
-TESTS = xbt/parallel_log_crashtest.tesh \
+TESTS = xbt/log_large_test.tesh xbt/parallel_log_crashtest.tesh \
gras/datadesc/datadesc_mem.tesh gras/datadesc/datadesc_rw.tesh \
gras/datadesc/datadesc_r_little32_4.tesh \
gras/datadesc/datadesc_r_little64.tesh \
gras/datadesc/datadesc_r_big32_2.tesh
LDADD_SG = $(abs_top_builddir)/src/libsimgrid.la
LDADD_RL = $(abs_top_builddir)/src/libgras.la
+xbt_log_large_test_LDADD = $(LDADD_SG)
xbt_parallel_log_crashtest_LDADD = $(LDADD_RL)
gras_datadesc_datadesc_usage_SOURCES = gras/datadesc/datadesc_usage.c gras/datadesc/datadesc_structs.c
gras_datadesc_datadesc_usage_LDADD = $(LDADD_RL)
xbt/$(am__dirstamp):
@$(MKDIR_P) xbt
@: > xbt/$(am__dirstamp)
+xbt/log_large_test$(EXEEXT): $(xbt_log_large_test_OBJECTS) $(xbt_log_large_test_DEPENDENCIES) xbt/$(am__dirstamp)
+ @rm -f xbt/log_large_test$(EXEEXT)
+ $(LINK) $(xbt_log_large_test_OBJECTS) $(xbt_log_large_test_LDADD) $(LIBS)
xbt/parallel_log_crashtest$(EXEEXT): $(xbt_parallel_log_crashtest_OBJECTS) $(xbt_parallel_log_crashtest_DEPENDENCIES) xbt/$(am__dirstamp)
@rm -f xbt/parallel_log_crashtest$(EXEEXT)
$(LINK) $(xbt_parallel_log_crashtest_OBJECTS) $(xbt_parallel_log_crashtest_LDADD) $(LIBS)
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/basic5.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/datadesc_structs.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/datadesc_usage.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/log_large_test.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msg_handle.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parallel_log_crashtest.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_comp_only_par.Po@am__quote@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_comp_only_seq.obj `if test -f 'simdag/partask/test_comp_only_seq.c'; then $(CYGPATH_W) 'simdag/partask/test_comp_only_seq.c'; else $(CYGPATH_W) '$(srcdir)/simdag/partask/test_comp_only_seq.c'; fi`
+log_large_test.o: xbt/log_large_test.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT log_large_test.o -MD -MP -MF $(DEPDIR)/log_large_test.Tpo -c -o log_large_test.o `test -f 'xbt/log_large_test.c' || echo '$(srcdir)/'`xbt/log_large_test.c
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/log_large_test.Tpo $(DEPDIR)/log_large_test.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='xbt/log_large_test.c' object='log_large_test.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o log_large_test.o `test -f 'xbt/log_large_test.c' || echo '$(srcdir)/'`xbt/log_large_test.c
+
+log_large_test.obj: xbt/log_large_test.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT log_large_test.obj -MD -MP -MF $(DEPDIR)/log_large_test.Tpo -c -o log_large_test.obj `if test -f 'xbt/log_large_test.c'; then $(CYGPATH_W) 'xbt/log_large_test.c'; else $(CYGPATH_W) '$(srcdir)/xbt/log_large_test.c'; fi`
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/log_large_test.Tpo $(DEPDIR)/log_large_test.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='xbt/log_large_test.c' object='log_large_test.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o log_large_test.obj `if test -f 'xbt/log_large_test.c'; then $(CYGPATH_W) 'xbt/log_large_test.c'; else $(CYGPATH_W) '$(srcdir)/xbt/log_large_test.c'; fi`
+
parallel_log_crashtest.o: xbt/parallel_log_crashtest.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT parallel_log_crashtest.o -MD -MP -MF $(DEPDIR)/parallel_log_crashtest.Tpo -c -o parallel_log_crashtest.o `test -f 'xbt/parallel_log_crashtest.c' || echo '$(srcdir)/'`xbt/parallel_log_crashtest.c
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/parallel_log_crashtest.Tpo $(DEPDIR)/parallel_log_crashtest.Po
#######################
+ #######################
+
##################
### GRAS tests ###
##################
--- /dev/null
+/* $Id$ */
+
+/* log_large_test -- log a very large string to test the dynamic variants */
+
+/* Copyright (c) 2007 Martin Quinson. All rights reserved. */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
+#include "gras.h"
+#include "xbt/synchro.h"
+
+XBT_LOG_NEW_DEFAULT_CATEGORY(test,"Logs of this example");
+
+
+int main(int argc, char *argv[]){
+ char *tmp=bprintf("\n%d%s%d%s%d%s%d%s%d%s%d%s%d%s%d%s%d%s%d%s",
+ 1,".........1.........2.........3.........4.........5.........6.........7.........8.........9.........0\n",
+ 2,".........1.........2.........3.........4.........5.........6.........7.........8.........9.........0\n",
+ 3,".........1.........2.........3.........4.........5.........6.........7.........8.........9.........0\n",
+ 4,".........1.........2.........3.........4.........5.........6.........7.........8.........9.........0\n",
+ 5,".........1.........2.........3.........4.........5.........6.........7.........8.........9.........0\n",
+ 6,".........1.........2.........3.........4.........5.........6.........7.........8.........9.........0\n",
+ 7,".........1.........2.........3.........4.........5.........6.........7.........8.........9.........0\n",
+ 8,".........1.........2.........3.........4.........5.........6.........7.........8.........9.........0\n",
+ 9,".........1.........2.........3.........4.........5.........6.........7.........8.........9.........0\n",
+ 0,".........1.........2.........3.........4.........5.........6.........7.........8.........9.........0\n");
+
+ xbt_init(&argc,argv);
+
+ INFO10("This is a very large message:0%s1%s2%s3%s4%s5%s6%s7%s8%s9%s",tmp,tmp,tmp,tmp,tmp,tmp,tmp,tmp,tmp,tmp);
+ INFO1("Done (strlen>%d)",10*strlen(tmp));
+ free(tmp);
+
+ xbt_exit();
+ return 0;
+}
--- /dev/null
+
+p Tries whether the dynamic version of the log layouts work
+$ $SG_EXENV_TEST xbt/log_large_test
+> [0.000000] [test/INFO] This is a very large message:0
+> 1.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 2.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 3.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 4.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 5.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 6.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 7.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 8.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 9.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 0.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 1
+> 1.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 2.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 3.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 4.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 5.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 6.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 7.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 8.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 9.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 0.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 2
+> 1.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 2.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 3.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 4.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 5.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 6.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 7.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 8.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 9.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 0.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 3
+> 1.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 2.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 3.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 4.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 5.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 6.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 7.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 8.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 9.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 0.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 4
+> 1.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 2.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 3.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 4.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 5.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 6.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 7.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 8.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 9.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 0.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 5
+> 1.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 2.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 3.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 4.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 5.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 6.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 7.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 8.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 9.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 0.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 6
+> 1.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 2.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 3.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 4.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 5.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 6.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 7.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 8.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 9.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 0.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 7
+> 1.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 2.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 3.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 4.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 5.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 6.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 7.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 8.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 9.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 0.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 8
+> 1.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 2.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 3.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 4.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 5.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 6.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 7.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 8.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 9.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 0.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 9
+> 1.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 2.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 3.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 4.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 5.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 6.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 7.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 8.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 9.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 0.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+>
+> [0.000000] [test/INFO] Done (strlen>10210)
+
+$ $SG_EXENV_TEST xbt/log_large_test --log=root.fmt:%m%n
+> This is a very large message:0
+> 1.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 2.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 3.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 4.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 5.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 6.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 7.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 8.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 9.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 0.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 1
+> 1.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 2.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 3.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 4.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 5.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 6.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 7.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 8.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 9.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 0.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 2
+> 1.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 2.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 3.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 4.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 5.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 6.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 7.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 8.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 9.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 0.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 3
+> 1.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 2.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 3.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 4.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 5.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 6.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 7.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 8.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 9.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 0.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 4
+> 1.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 2.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 3.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 4.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 5.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 6.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 7.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 8.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 9.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 0.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 5
+> 1.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 2.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 3.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 4.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 5.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 6.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 7.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 8.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 9.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 0.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 6
+> 1.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 2.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 3.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 4.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 5.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 6.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 7.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 8.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 9.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 0.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 7
+> 1.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 2.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 3.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 4.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 5.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 6.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 7.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 8.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 9.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 0.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 8
+> 1.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 2.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 3.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 4.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 5.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 6.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 7.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 8.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 9.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 0.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 9
+> 1.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 2.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 3.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 4.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 5.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 6.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 7.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 8.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 9.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+> 0.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0
+>
+> Done (strlen>10210)