oni_comb_parser_rs/internal/parser_impl/
logging_parser_impl.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
use crate::core::Parser;
use crate::extension::parser::LoggingParser;
use crate::extension::parsers::{LogLevel, LoggingParsers};
use crate::internal::ParsersImpl;
use std::fmt::Debug;

impl<'a, I, A> LoggingParser<'a> for Parser<'a, I, A> {
  fn log(self, name: &'a str, log_level: LogLevel) -> Self::P<'a, Self::Input, Self::Output>
  where
    Self::Input: Debug,
    Self::Output: Debug + 'a, {
    ParsersImpl::log(self, name, log_level)
  }

  fn debug(self, name: &'a str) -> Self::P<'a, Self::Input, Self::Output>
  where
    Self::Input: Debug,
    Self::Output: Debug + 'a, {
    ParsersImpl::log(self, name, LogLevel::Debug)
  }

  fn info(self, name: &'a str) -> Self::P<'a, Self::Input, Self::Output>
  where
    Self::Input: Debug,
    Self::Output: Debug + 'a, {
    ParsersImpl::log(self, name, LogLevel::Info)
  }

  fn warn(self, name: &'a str) -> Self::P<'a, Self::Input, Self::Output>
  where
    Self::Input: Debug,
    Self::Output: Debug + 'a, {
    ParsersImpl::log(self, name, LogLevel::Warn)
  }

  fn error(self, name: &'a str) -> Self::P<'a, Self::Input, Self::Output>
  where
    Self::Input: Debug,
    Self::Output: Debug + 'a, {
    ParsersImpl::log(self, name, LogLevel::Err)
  }

  fn name(self, name: &'a str) -> Self::P<'a, Self::Input, Self::Output>
  where
    Self::Input: Debug,
    Self::Output: Debug + 'a, {
    ParsersImpl::name(self, name)
  }
}