A class for handling multi-target log streams.  
 More...
#include <MultiStream.hpp>
 | 
|   | MultiStream (bool use_utf8=true) | 
|   | Default constructor for MultiStream without LogIt integration.  
  | 
|   | 
|   | ~MultiStream () | 
|   | Destructor to flush the accumulated log content.  
  | 
|   | 
| template<typename T>  | 
| MultiStream &  | operator<< (const T &value) | 
|   | Overloaded operator<< for adding content to the stream.  
  | 
|   | 
| MultiStream &  | operator<< (std::ostream &(*manip)(std::ostream &)) | 
|   | Overloaded operator<< for manipulators (e.g., std::endl).  
  | 
|   | 
 | 
| void  | flush_to_console (const std::string &message) const | 
|   | Flush the accumulated message to the console on non-Windows platforms.  
  | 
|   | 
 | 
| std::ostringstream  | m_stream | 
|   | Internal stream for accumulating log content.  
  | 
|   | 
| bool  | m_use_utf8 | 
|   | Flag indicating whether UTF-8 encoding should be used.  
  | 
|   | 
A class for handling multi-target log streams. 
MultiStream ensures consistent and platform-independent logging output:
- On Windows, UTF-8 strings are automatically converted to CP866 to support legacy console encoding.
 
- On Linux/macOS, UTF-8 strings are directly output to the console.
 
- Supports ANSI color codes for enhanced readability.
 
- Integrates with LogIt logging library for advanced log management (if enabled).
 
- Supports LogIt integration (if enabled) and platform-specific console handling. 
 
Definition at line 26 of file MultiStream.hpp.
 
◆ MultiStream()
  
  
      
        
          | consolix::MultiStream::MultiStream  | 
          ( | 
          bool |           use_utf8 = true | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Default constructor for MultiStream without LogIt integration. 
- Parameters
 - 
  
    | use_utf8 | Flag to indicate if UTF-8 encoding should be used.  | 
  
   
Definition at line 54 of file MultiStream.hpp.
 
 
◆ ~MultiStream()
  
  
      
        
          | consolix::MultiStream::~MultiStream  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Destructor to flush the accumulated log content. 
Definition at line 59 of file MultiStream.hpp.
 
 
◆ flush_to_console()
  
  
      
        
          | void consolix::MultiStream::flush_to_console  | 
          ( | 
          const std::string & |           message | ) | 
           const | 
         
       
   | 
  
inlineprivate   | 
  
 
Flush the accumulated message to the console on non-Windows platforms. 
- Parameters
 - 
  
    | message | The message to flush.  | 
  
   
Definition at line 118 of file MultiStream.hpp.
 
 
◆ operator<<() [1/2]
template<typename T> 
  
  
      
        
          | MultiStream & consolix::MultiStream::operator<<  | 
          ( | 
          const T & |           value | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Overloaded operator<< for adding content to the stream. 
- Template Parameters
 - 
  
    | T | The type of the content to log.  | 
  
   
- Parameters
 - 
  
  
 
- Returns
 - Reference to the current MultiStream object. 
 
Definition at line 91 of file MultiStream.hpp.
 
 
◆ operator<<() [2/2]
  
  
      
        
          | MultiStream & consolix::MultiStream::operator<<  | 
          ( | 
          std::ostream &(* |           manip )(std::ostream &) | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Overloaded operator<< for manipulators (e.g., std::endl). 
- Parameters
 - 
  
    | manip | Manipulator function (e.g., std::endl).  | 
  
   
- Returns
 - Reference to the current MultiStream object. 
 
Definition at line 99 of file MultiStream.hpp.
 
 
◆ m_stream
  
  
      
        
          | std::ostringstream consolix::MultiStream::m_stream | 
         
       
   | 
  
private   | 
  
 
Internal stream for accumulating log content. 
Definition at line 105 of file MultiStream.hpp.
 
 
◆ m_use_utf8
  
  
      
        
          | bool consolix::MultiStream::m_use_utf8 | 
         
       
   | 
  
private   | 
  
 
Flag indicating whether UTF-8 encoding should be used. 
Definition at line 113 of file MultiStream.hpp.
 
 
The documentation for this class was generated from the following file: