| The Gaudi Framework v32r1 (f65d50dc)

Macros | Functions
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

## ◆ KERNEL_MSGSTREAM_CPP

#define KERNEL_MSGSTREAM_CPP

Definition at line 18 of file MsgStream.cpp.

## Function Documentation

## ◆ format()

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

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

Definition at line 109 of file MsgStream.cpp.

109 {
110 const int buffsize = 2048;
111 static char buffer[buffsize];
112 va_list arguments;
113 va_start( arguments, fmt );
114 if ( vsnprintf( buffer, buffsize, fmt, arguments ) >= buffsize )
115 throw GaudiException( "Insufficient buffer size (" + std::to_string( buffsize ) + ") when formatting message",
116 "MsgStream", StatusCode::FAILURE );
117 va_end( arguments );
118 return std::string( buffer );
119 }
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:21
std::to_string
T to_string(T... args)
std::string
STL class.
std::vsnprintf
T vsnprintf(T... args)
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
va_list