mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-12-01 16:46:39 +00:00
Fix log_ok()
This commit is contained in:
@@ -96,17 +96,6 @@ impl<T, R: Loggable<T>> ResultExt<T> for R {
|
|||||||
self.do_log(LogLevel::Error, Some(Location::caller()))
|
self.do_log(LogLevel::Error, Some(Location::caller()))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[track_caller]
|
|
||||||
#[cfg(debug_assertions)]
|
|
||||||
fn log_ok(self) {
|
|
||||||
self.log().ok();
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(not(debug_assertions))]
|
|
||||||
fn log_ok(self) {
|
|
||||||
self.log().ok();
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(not(debug_assertions))]
|
#[cfg(not(debug_assertions))]
|
||||||
fn log_with_msg<F: FnOnce(Formatter) -> fmt::Result>(self, f: F) -> LoggedResult<T> {
|
fn log_with_msg<F: FnOnce(Formatter) -> fmt::Result>(self, f: F) -> LoggedResult<T> {
|
||||||
self.do_log_msg(LogLevel::Error, None, f)
|
self.do_log_msg(LogLevel::Error, None, f)
|
||||||
@@ -117,6 +106,17 @@ impl<T, R: Loggable<T>> ResultExt<T> for R {
|
|||||||
fn log_with_msg<F: FnOnce(Formatter) -> fmt::Result>(self, f: F) -> LoggedResult<T> {
|
fn log_with_msg<F: FnOnce(Formatter) -> fmt::Result>(self, f: F) -> LoggedResult<T> {
|
||||||
self.do_log_msg(LogLevel::Error, Some(Location::caller()), f)
|
self.do_log_msg(LogLevel::Error, Some(Location::caller()), f)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(not(debug_assertions))]
|
||||||
|
fn log_ok(self) {
|
||||||
|
self.log().ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
#[track_caller]
|
||||||
|
#[cfg(debug_assertions)]
|
||||||
|
fn log_ok(self) {
|
||||||
|
self.do_log(LogLevel::Error, Some(Location::caller())).ok();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T> Loggable<T> for LoggedResult<T> {
|
impl<T> Loggable<T> for LoggedResult<T> {
|
||||||
|
|||||||
Reference in New Issue
Block a user