Replace print_warning
and print_error
utility functions with macros
- Implement `eprintln_warn` and `eprintln_warn` macros. - Move generalised, utility macros to the utils module. - Refactor `format_str` to `format_static`. - Remove re-exports of ansi functions from utils module.
This commit is contained in:
parent
f5e5c01697
commit
e790ddaaa3
15 changed files with 101 additions and 95 deletions
|
@ -28,6 +28,7 @@ use serde::Deserialize;
|
|||
use pacwrap_core::{
|
||||
config::Global,
|
||||
constants::{VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH},
|
||||
eprintln_warn,
|
||||
err,
|
||||
log::{Level, Logger},
|
||||
sync::{
|
||||
|
@ -42,7 +43,7 @@ use pacwrap_core::{
|
|||
AlpmConfigData,
|
||||
SyncError,
|
||||
},
|
||||
utils::{bytebuffer::ByteBuffer, print_warning},
|
||||
utils::{ansi::*, bytebuffer::ByteBuffer},
|
||||
Error,
|
||||
ErrorGeneric,
|
||||
Result,
|
||||
|
@ -139,7 +140,7 @@ fn conduct_transaction(
|
|||
if error.kind() != NotFound {
|
||||
let message = &format!("Failed to propagate ld.so.cache: {}", error);
|
||||
|
||||
print_warning(message);
|
||||
eprintln_warn!("{}", message);
|
||||
logger.log(Level::Warn, message)?;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue