Back to index

nux  3.0.0
Public Member Functions | Private Types | Private Attributes
nux::logging::Writer::Impl Class Reference
Collaboration diagram for nux::logging::Writer::Impl:
Collaboration graph

List of all members.

Public Member Functions

 Impl ()
void WriteMessage (Level severity, std::string const &module, std::string const &filename, int line_number, std::time_t timestamp, std::string const &message)
void SetOutputStream (std::ostream &out)

Private Types

typedef std::vector
< StreamWrapper::Ptr > 

Private Attributes

OutputStreams output_streams_

Detailed Description

Definition at line 112 of file LoggingWriter.cpp.

Member Typedef Documentation

typedef std::vector<StreamWrapper::Ptr> nux::logging::Writer::Impl::OutputStreams [private]

Definition at line 127 of file LoggingWriter.cpp.

Constructor & Destructor Documentation

Definition at line 131 of file LoggingWriter.cpp.

  output_streams_.push_back(StreamWrapper::Ptr(new StreamWrapper(std::cout)));

Member Function Documentation

void nux::logging::Writer::Impl::SetOutputStream ( std::ostream &  out)

Definition at line 136 of file LoggingWriter.cpp.

  output_streams_.push_back(StreamWrapper::Ptr(new StreamWrapper(out)));

Here is the caller graph for this function:

void nux::logging::Writer::Impl::WriteMessage ( Level  severity,
std::string const &  module,
std::string const &  filename,
int  line_number,
std::time_t  timestamp,
std::string const &  message 

Definition at line 142 of file LoggingWriter.cpp.

  // If we want to have some form of custom formatter, here is where we do it.
  // Right now, format the line independently, and then write it to each
  // output stream.
  std::stringstream sout;
  sout << severity_string(severity)
       << " " << TimestampString(timestamp)
       << " " << module
       << " " << ShortenedFilename(filename)
       << ":" << line_number
       << " " << message;
  for (OutputStreams::iterator i = output_streams_.begin(), end = output_streams_.end();
       i != end; ++i)
    std::ostream& out = (*i)->out;
    out << sout.rdbuf() << std::endl;

#if defined(NUX_OS_WINDOWS) && defined(NUX_DEBUG)
  // Quick hack to print messages to Visual Studio output.
  // Should create a Visual Studio StreamWrapper instead!
  OutputDebugString (sout.str().c_str());


Here is the caller graph for this function:

Member Data Documentation

Definition at line 128 of file LoggingWriter.cpp.

The documentation for this class was generated from the following file: