Added Logger constructors to write output to arbitrary streams.
This commit is contained in:
parent
8a587eb57a
commit
eff3b45089
@ -21,7 +21,9 @@ namespace output
|
|||||||
class Logger
|
class Logger
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Logger();
|
explicit Logger();
|
||||||
|
explicit Logger(ColorStream &&outputStream);
|
||||||
|
explicit Logger(ColorStream &&outputStream, ColorStream &&errorStream);
|
||||||
|
|
||||||
ColorStream &outputStream();
|
ColorStream &outputStream();
|
||||||
ColorStream &errorStream();
|
ColorStream &errorStream();
|
||||||
|
@ -60,8 +60,22 @@ constexpr const Format LocationFormat = {Color::White, FontWeight::Bold};
|
|||||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
Logger::Logger()
|
Logger::Logger()
|
||||||
: m_outputStream{std::cout},
|
: Logger(std::cout, std::cerr)
|
||||||
m_errorStream{std::cerr},
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
Logger::Logger(ColorStream &&outputStream)
|
||||||
|
: Logger(std::forward<ColorStream &&>(outputStream), std::cerr)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
Logger::Logger(ColorStream &&outputStream, ColorStream &&errorStream)
|
||||||
|
: m_outputStream{outputStream},
|
||||||
|
m_errorStream{errorStream},
|
||||||
m_outputPriority{Priority::Warning}
|
m_outputPriority{Priority::Warning}
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user