projects
/
rust-lightning
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add version and TLV suffix for more user-facing "major" structs
[rust-lightning]
/
lightning
/
src
/
util
/
logger.rs
diff --git
a/lightning/src/util/logger.rs
b/lightning/src/util/logger.rs
index 6d42fbf01c64c45a8259ce59d3308f0ab5ec2f6d..df2b7f704051958a1e8ddc63523108061c8cfb08 100644
(file)
--- a/
lightning/src/util/logger.rs
+++ b/
lightning/src/util/logger.rs
@@
-14,8
+14,8
@@
//! The second one, client-side by implementing check against Record Level field.
//! Each module may have its own Logger or share one.
//! The second one, client-side by implementing check against Record Level field.
//! Each module may have its own Logger or share one.
-use
std
::cmp;
-use
std
::fmt;
+use
core
::cmp;
+use
core
::fmt;
static LOG_LEVEL_NAMES: [&'static str; 6] = ["OFF", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"];
static LOG_LEVEL_NAMES: [&'static str; 6] = ["OFF", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"];
@@
-86,6
+86,7
@@
impl Level {
/// A Record, unit of logging output with Metadata to enable filtering
/// Module_path, file, line to inform on log's source
/// A Record, unit of logging output with Metadata to enable filtering
/// Module_path, file, line to inform on log's source
+/// (C-not exported) - we convert to a const char* instead
#[derive(Clone,Debug)]
pub struct Record<'a> {
/// The verbosity level of the message.
#[derive(Clone,Debug)]
pub struct Record<'a> {
/// The verbosity level of the message.
@@
-102,6
+103,7
@@
pub struct Record<'a> {
impl<'a> Record<'a> {
/// Returns a new Record.
impl<'a> Record<'a> {
/// Returns a new Record.
+ /// (C-not exported) as fmt can't be used in C
#[inline]
pub fn new(level: Level, args: fmt::Arguments<'a>, module_path: &'a str, file: &'a str, line: u32) -> Record<'a> {
Record {
#[inline]
pub fn new(level: Level, args: fmt::Arguments<'a>, module_path: &'a str, file: &'a str, line: u32) -> Record<'a> {
Record {
@@
-115,7
+117,7
@@
impl<'a> Record<'a> {
}
/// A trait encapsulating the operations required of a logger
}
/// A trait encapsulating the operations required of a logger
-pub trait Logger
: Sync + Send
{
+pub trait Logger {
/// Logs the `Record`
fn log(&self, record: &Record);
}
/// Logs the `Record`
fn log(&self, record: &Record);
}