pub struct LogFormat;Expand description
ログメッセージのフォーマットユーティリティ
Implementations§
Source§impl LogFormat
impl LogFormat
Sourcepub fn error(class: &str, method: &str, message: &str) -> String
pub fn error(class: &str, method: &str, message: &str) -> String
エラーログを生成
例: State::get: metadata not found
§Arguments
class- クラス名method- メソッド名message- エラーメッセージ
Sourcepub fn format_arg(value: &Value) -> String
pub fn format_arg(value: &Value) -> String
引数を読みやすくフォーマット(declare-engine の formatArgs 相当)
- 文字列: 50文字で省略
- 配列: 要素数を表示
- オブジェクト: フィールド数を表示
- null/bool/数値: そのまま
Sourcepub fn format_str_arg(s: &str) -> String
pub fn format_str_arg(s: &str) -> String
文字列引数をフォーマット
Auto Trait Implementations§
impl Freeze for LogFormat
impl RefUnwindSafe for LogFormat
impl Send for LogFormat
impl Sync for LogFormat
impl Unpin for LogFormat
impl UnwindSafe for LogFormat
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more