text: /*
   * Copyright (c) 2018-2019, The Aonecoin Developers.
   * Portions Copyright (c) 2012-2017, The CryptoNote Developers, The Bytecoin Developers.
   *
   * This file is part of Aonecoin.
   *
   * This file is subject to the terms and conditions defined in the
   * file 'LICENSE', which is part of this source code package.
   */
  
  #pragma once
  
  #include <iostream>
  #include "ILogger.h"
  
  namespace Logging {
  
  class LoggerMessage : public std::ostream, std::streambuf {
  public:
    LoggerMessage(ILogger& logger, const std::string& category, Level level, const std::string& color);
    ~LoggerMessage();
    LoggerMessage(const LoggerMessage&) = delete;
    LoggerMessage& operator=(const LoggerMessage&) = delete;
    LoggerMessage(LoggerMessage&& other);
  
  private:
    int sync() override;
    std::streamsize xsputn(const char* s, std::streamsize n) override;
    int overflow(int c) override;
  
    std::string message;
    const std::string category;
    Level logLevel;
    ILogger& logger;
    boost::posix_time::ptime timestamp;
    bool gotText;
  };
  
  }
  