| The Gaudi Framework v29r0 (ff2e7097)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

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

#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 }
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:22
std::to_string
T to_string(T...args)
std::string
STL class.
std::vsnprintf
T vsnprintf(T...args)
va_list