OpenRTM-aist 2.0.2
読み取り中…
検索中…
一致する文字列を見つけられません
LogstreamFile.h
[詳解]
1// -*- C++ -*-
18#ifndef RTC_LOGSTREAMFILE_H
19#define RTC_LOGSTREAMFILE_H
20
21#include <string>
22#include <fstream>
23#include <iostream>
24#include <coil/stringutil.h>
25#include <rtm/LogstreamBase.h>
26
27namespace RTC
28{
42 class FileStreamBase : public coil::LogStreamBuffer
43 {
44 public:
62 FileStreamBase() = default;
78 ~FileStreamBase() override = default;
104 void header(int level, const std::string &name, const std::string &date, bool es_enable = false);
105
118 void flush() override;
155
182 void write(int level, const std::string &name, const std::string &date, const std::string &mes) override;
183
184 protected:
185 std::basic_ostream<char> *m_stream;
187 };
188
203 {
204 public:
238 ~StdoutStream() override;
239
240
241
242 };
243
258 {
259 public:
293 ~StderrStream() override;
294
295
296
297 };
298
313 {
314 public:
336 FileStream(const std::string& filename);
352 ~FileStream() override;
368 bool is_open();
383 void close();
384
385
386 private:
387 std::filebuf m_fileout;
388 };
414 : public LogstreamBase
415 {
416 public:
429
441 ~LogstreamFile() override;
442
464 bool init(const coil::Properties& prop) override;
465
485 coil::LogStreamBuffer* getStreamBuffer() override;
486
487 protected:
488 static coil::vstring s_files;
489 std::string m_fileName;
492 };
493} // namespace RTC
494
495extern "C"
496{
498}
499
500#endif // RTC_LOGSTREAMFILE_H
Logger stream buffer base class
void LogstreamFileInit()
ファイル出力のストリーミングバッファ基底クラス
Definition LogstreamFile.h:43
std::basic_ostream< char > * m_stream
Definition LogstreamFile.h:185
~FileStreamBase() override=default
デストラクタ
bool m_esEnable
Definition LogstreamFile.h:186
void disableEscapeSequence()
エスケープシーケンスを無効にする
FileStreamBase()=default
コンストラクタ
void enableEscapeSequence()
エスケープシーケンスを有効にする
void header(int level, const std::string &name, const std::string &date, bool es_enable=false)
ログメッセージのヘッダーの設定
void write(int level, const std::string &name, const std::string &date, const std::string &mes) override
ログの出力
void flush() override
標準出力のバッファのフラッシュ
ファイル出力のストリーミングラッパークラス
Definition LogstreamFile.h:313
~FileStream() override
デストラクタ
bool is_open()
ファイルを開くことに成功したかの確認
FileStream(const std::string &filename)
コンストラクタ
void close()
ファイルを閉じる
Definition LogstreamBase.h:57
Definition LogstreamFile.h:415
coil::LogStreamBuffer * getStreamBuffer() override
basic_strembuf へのポインタを返す
~LogstreamFile() override
デストラクタ
static coil::vstring s_files
Definition LogstreamFile.h:488
FileStream * m_fileout
Definition LogstreamFile.h:491
LogstreamFile()
コンストラクタ
std::string m_fileName
Definition LogstreamFile.h:489
bool init(const coil::Properties &prop) override
設定初期化
FileStreamBase * m_stdout
Definition LogstreamFile.h:490
標準エラー出力のストリーミングラッパークラス
Definition LogstreamFile.h:258
StderrStream()
コンストラクタ
~StderrStream() override
デストラクタ
標準出力のストリーミングラッパークラス
Definition LogstreamFile.h:203
StdoutStream()
コンストラクタ
~StdoutStream() override
デストラクタ
RTコンポーネント