AAO DRAMA/DRAMA2 C++ Interface
DRAMA C++11 and later interface

◆ SLog() [1/2]

template<typename... Types>
void drama::logging::Logger::SLog ( std::ostream &  ostream,
unsigned  level,
const std::string &  prefix,
const std::string &  fmt,
Types...  args 
)
inline

Log a message using type safe formatting and output to a stream.

Explictly log a message. Type Safe formatting. Also output the message to a stream.

This version is probably slower then the Log() version and provides no way to influence the formatting. But in many cases its type safety is what really matters.

Since the result of the formatting is easly output to a stream, this override of SLog() takes an ostream argument and also outputs the message there.

Parameters
ostreamThe stream to also output the message to. A new-line is also output after the message.
levelThe logging level. One of the D2LOG_ macro values
prefixA prefix to the log message, often indicting the function which makes the call.
fmtThe format string. Each % character is to be replaced by the corresponding argument. Note - only the % is needed and used, don't do for example "%d". To output a %, use "%%".
argsThen the arguments to the format.
Template Parameters
Types...the argument types.

References drama::CreateRunDramaTask(), Log(), and drama::SafePrintf().