The Gaudi Framework  v28r3 (cc1cf868)
MsgStream.cpp File Reference
#include "GaudiKernel/MsgStream.h"
#include "GaudiKernel/Message.h"
#include "GaudiKernel/GaudiException.h"
#include "GaudiKernel/IMessageSvc.h"
#include <iostream>
#include <cstdarg>
#include <cstdio>
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 121 of file MsgStream.cpp.

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