| The Gaudi Framework v28r2p1 (f1a77ff4)

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

- File List
- File Members

Macros | Functions
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 119 of file MsgStream.cpp.

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