Class to allowing messages to be logged to a combination of one or more destinations such as the console, log file or output window in Visual Studio.
More...
#include <Log.hpp>
|
enum | Output { Console,
File,
All
} |
|
enum | Type { Info,
Warning,
Error
} |
|
|
static std::ostream & | log (Type=Type::Info, Output=Output::Console) |
| Outputs to the log via the stream operator << Simplified output interface wo allow logging similar to cout or cerr. More...
|
|
static void | log (const std::string &message, Type type=Type::Info, Output output=Output::Console) |
| Logs a message to a given destination. More...
|
|
Class to allowing messages to be logged to a combination of one or more destinations such as the console, log file or output window in Visual Studio.
◆ log() [1/2]
static void xy::Logger::log |
( |
const std::string & |
message, |
|
|
Type |
type = Type::Info , |
|
|
Output |
output = Output::Console |
|
) |
| |
|
static |
Logs a message to a given destination.
- Parameters
-
message | Message to log |
type | Whether this message gets tagged as information, a warning or an error |
output | Destination for the message. Can be the console via cout, a log file on disk, or both |
◆ log() [2/2]
static std::ostream& xy::Logger::log |
( |
Type |
= Type::Info , |
|
|
Output |
= Output::Console |
|
) |
| |
|
static |
Outputs to the log via the stream operator << Simplified output interface wo allow logging similar to cout or cerr.
- Parameters
-
type | Type of output. Defaults to Info |
output | Output destination. Defaults to Console. Example:
Logger::log(Logger::Type::Error) << "something is wrong!" << std::endl;
|
static std::ostream & log(Type=Type::Info, Output=Output::Console)
Outputs to the log via the stream operator << Simplified output interface wo allow logging similar to...