The Gaudi Framework  v29r0 (ff2e7097)
MsgStream.cpp File Reference
#include "GaudiKernel/MsgStream.h"
#include "GaudiKernel/GaudiException.h"
#include "GaudiKernel/IMessageSvc.h"
#include "GaudiKernel/Message.h"
#include <cstdarg>
#include <cstdio>
#include <iostream>
Include dependency graph for MsgStream.cpp:

Go to the source code of this file.

Macros

#define KERNEL_MSGSTREAM_CPP
 

Functions

std::string format (const char *fmt,...)
 MsgStream format utility "a la sprintf(...)". More...
 

Macro Definition Documentation

#define KERNEL_MSGSTREAM_CPP

Definition at line 18 of file MsgStream.cpp.

Function Documentation

std::string format ( const char *  fmt,
  ... 
)

MsgStream format utility "a la sprintf(...)".

Definition at line 120 of file MsgStream.cpp.

121 {
122  const int buffsize = 2048;
123  static char buffer[buffsize];
124  va_list arguments;
125  va_start( arguments, fmt );
126  if ( vsnprintf( buffer, buffsize, fmt, arguments ) >= buffsize )
127  throw GaudiException( "Insufficient buffer size (" + std::to_string( buffsize ) + ") when formatting message",
128  "MsgStream", 0 );
129  va_end( arguments );
130  return std::string( buffer );
131 }
Define general base for Gaudi exception.
T to_string(T...args)
STL class.
T vsnprintf(T...args)