pub struct FixedLevel { /* private fields */ }
Implementations§
Source§impl FixedLevel
impl FixedLevel
Sourcepub fn new(level: Level) -> Self
pub fn new(level: Level) -> Self
Examples found in repository?
examples/formater.rs (line 30)
29pub fn format(_: &BaseFormater, record: &Record) -> String {
30 let level = FixedLevel::new(record.level()).length(4);
31
32 // format!(
33 // "[{} {}#{}:{} {}] {}\n",
34 // chrono::Local::now().format("%Y-%m-%d %H:%M:%S.%3f"),
35 // level,
36 // record.module_path().unwrap_or("*"),
37 // // record.file().unwrap_or("*"),
38 // record.line().unwrap_or(0),
39 // nonblock_logger::current_thread_name(),
40 // record.args()
41 // )
42
43 format!(
44 "{} [#{}:{}] {}\n",
45 level,
46 // record.module_path().unwrap_or("*"),
47 record.file().unwrap_or("*"),
48 record.line().unwrap_or(0),
49 record.args()
50 )
51}
Sourcepub fn length(self, length: usize) -> Self
pub fn length(self, length: usize) -> Self
Examples found in repository?
examples/formater.rs (line 30)
29pub fn format(_: &BaseFormater, record: &Record) -> String {
30 let level = FixedLevel::new(record.level()).length(4);
31
32 // format!(
33 // "[{} {}#{}:{} {}] {}\n",
34 // chrono::Local::now().format("%Y-%m-%d %H:%M:%S.%3f"),
35 // level,
36 // record.module_path().unwrap_or("*"),
37 // // record.file().unwrap_or("*"),
38 // record.line().unwrap_or(0),
39 // nonblock_logger::current_thread_name(),
40 // record.args()
41 // )
42
43 format!(
44 "{} [#{}:{}] {}\n",
45 level,
46 // record.module_path().unwrap_or("*"),
47 record.file().unwrap_or("*"),
48 record.line().unwrap_or(0),
49 record.args()
50 )
51}
Trait Implementations§
Source§impl AsRef<str> for FixedLevel
impl AsRef<str> for FixedLevel
Source§impl Clone for FixedLevel
impl Clone for FixedLevel
Source§fn clone(&self) -> FixedLevel
fn clone(&self) -> FixedLevel
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for FixedLevel
impl Debug for FixedLevel
Source§impl Display for FixedLevel
impl Display for FixedLevel
impl Copy for FixedLevel
Auto Trait Implementations§
impl Freeze for FixedLevel
impl RefUnwindSafe for FixedLevel
impl Send for FixedLevel
impl Sync for FixedLevel
impl Unpin for FixedLevel
impl UnwindSafe for FixedLevel
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