diff --git a/src/shared/ByteBuffer.h b/src/shared/ByteBuffer.h index acbb7f35633..f1d014f8353 100644 --- a/src/shared/ByteBuffer.h +++ b/src/shared/ByteBuffer.h @@ -54,11 +54,20 @@ class ByteBufferException void PrintPosError() const { + char const* traceStr; + +#ifdef HAVE_ACE_STACK_TRACE_H ACE_Stack_Trace trace; + traceStr = trace.c_str(); +#else + traceStr = NULL; +#endif + sLog.outError( "Attempted to %s in ByteBuffer (pos: " SIZEFMTD " size: "SIZEFMTD") " - "value with size: " SIZEFMTD "\n%s", - (add ? "put" : "get"), pos, size, esize, trace.c_str()); + "value with size: " SIZEFMTD "%s%s", + (add ? "put" : "get"), pos, size, esize, + traceStr ? "\n" : "", traceStr ? traceStr : ""); } private: bool add;