|
OpenRTM-aist 2.1.0
|
#include <SystemLogger.h>


公開型 | |
| enum | { RTL_SILENT , RTL_FATAL , RTL_ERROR , RTL_WARN , RTL_INFO , RTL_DEBUG , RTL_TRACE , RTL_VERBOSE , RTL_PARANOID } |
公開メンバ関数 | |
| Logger (const char *name="") | |
| コンストラクタ | |
| Logger (LogStreamBuf *streambuf) | |
| コンストラクタ | |
| ~Logger () override | |
| 仮想デストラクタ | |
| bool | setLevel (const char *level) |
| ログレベルを文字列で設定する | |
| void | setDateFormat (const char *format) |
| ヘッダに付加する日時フォーマットを指定する。 | |
| void | setClockType (const std::string &clocktype) |
| ログ記録時に使用するクロックを指定する | |
| void | setName (const char *name) |
| ヘッダの日時の後に付加する文字列を設定する。 | |
| void | write (int level, const std::string &mes) override |
| ログの出力 | |
| void | write (int level, const coil::Properties &prop) |
| ログの出力 | |
静的公開メンバ関数 | |
| static std::string | getLevelString (int level) |
| ログレベルを数値から文字列に変換 | |
| static std::string | getLevelOutputString (int level) |
| ログレベルを対応した出力用の文字列に変換 | |
| static std::string | getLevelColor (int level) |
| ログレベルを対応したエスケープシケーンスに変換 | |
限定公開メンバ関数 | |
| std::string | getDate () |
| フォーマットされた現在日時文字列を取得する。 指定された書式で記述した現在日時を取得する。 | |
静的限定公開メンバ関数 | |
| static int | strToLevel (const char *level) |
| ログレベル設定 与えられた文字列に対応したログレベルを設定する。 | |
Logger クラス
| anonymous enum |
|
explicit |
コンストラクタ
コンストラクタ
| name | ヘッダの日時の後に付加する文字列 |
|
explicit |
|
override |
仮想デストラクタ
|
protected |
フォーマットされた現在日時文字列を取得する。 指定された書式で記述した現在日時を取得する。
|
inlinestatic |
ログレベルを対応したエスケープシケーンスに変換
| level | ログレベル |
|
inlinestatic |
ログレベルを対応した出力用の文字列に変換
| level | ログレベル |
|
inlinestatic |
ログレベルを数値から文字列に変換
| level | ログレベル |
| void RTC::Logger::setClockType | ( | const std::string & | clocktype | ) |
ログ記録時に使用するクロックを指定する
ログ記録時に時刻を取得するためのクロックの種類を指定することができる。
論理時間クロックについては
coil::ClockManager::instance().getClock("logical").settime()
で時刻を設定する必要がある。
| clocktype | 上述のクロックタイプ |
| void RTC::Logger::setDateFormat | ( | const char * | format | ) |
ヘッダに付加する日時フォーマットを指定する。
フォーマット指定文字列は以下のとおり。
%a abbreviated weekday name %A full weekday name %b abbreviated month name %B full month name %c the standard date and time string %d day of the month, as a number (1-31) %H hour, 24 hour format (0-23) %I hour, 12 hour format (1-12) %j day of the year, as a number (1-366) %m month as a number (1-12). Note: some versions of Microsoft Visual C++ may use values that range from 0-11. %M minute as a number (0-59) %p locale's equivalent of AM or PM %Q millisecond as a number (0-999) from ver 1.1 %q microsecond as a number (0-999) from ver 1.1 %S second as a number (0-59) %U week of the year, sunday as the first day %w weekday as a decimal (0-6, sunday=0) %W week of the year, monday as the first day %x standard date string %X standard time string %y year in decimal, without the century (0-99) %Y year in decimal, with the century %Z time zone name %% a percent sign
| fmt | 日時フォーマット |
| bool RTC::Logger::setLevel | ( | const char * | level | ) |
ログレベルを文字列で設定する
| level | ログレベル |
| void RTC::Logger::setName | ( | const char * | name | ) |
ヘッダの日時の後に付加する文字列を設定する。
ヘッダの日時の後に付加する接頭語文字列を設定する。
| suffix | 接頭語文字列 |
|
staticprotected |
ログレベル設定 与えられた文字列に対応したログレベルを設定する。
| lv | ログレベル文字列 |
| void RTC::Logger::write | ( | int | level, |
| const coil::Properties & | prop ) |
ログの出力
指定したプロパティを文字列に変換してログに出力する
| level | ログレベル |
| prop | プロパティ |
|
override |
ログの出力
指定したメッセージのログを出力する
| level | ログレベル |
| mes | メッセージ |