Remove useless argument of logging macros

Previously, logging macros (info! warn! error!) accepted integer
argument (data1), that was passed to callback function verbatim. In all
call sites this argument was 0.

With this change, that data1 argument is no longer part of macro
interface, 0 is always passed to callback in internals of these macros.
This commit is contained in:
Dmitry Bogatov
2019-09-10 19:04:21 +00:00
parent 2dd3f169db
commit 57daa0f7f0
26 changed files with 257 additions and 379 deletions

View File

@@ -852,7 +852,7 @@ pub fn dc_delete_file(context: &Context, path: impl AsRef<std::path::Path>) -> b
match res {
Ok(_) => true,
Err(_err) => {
warn!(context, 0, "Cannot delete \"{}\".", path.as_ref().display());
warn!(context, "Cannot delete \"{}\".", path.as_ref().display());
false
}
}
@@ -870,7 +870,6 @@ pub fn dc_copy_file(
Err(_) => {
error!(
context,
0,
"Cannot copy \"{}\" to \"{}\".",
src.as_ref().display(),
dest.as_ref().display(),
@@ -888,7 +887,6 @@ pub fn dc_create_folder(context: &Context, path: impl AsRef<std::path::Path>) ->
Err(_err) => {
warn!(
context,
0,
"Cannot create directory \"{}\".",
path.as_ref().display(),
);
@@ -921,7 +919,6 @@ pub fn dc_write_file_safe<P: AsRef<std::path::Path>>(
if let Err(_err) = fs::write(&path_abs, buf) {
warn!(
context,
0,
"Cannot write {} bytes to \"{}\".",
buf.len(),
path.as_ref().display(),
@@ -959,7 +956,6 @@ pub fn dc_read_file_safe<P: AsRef<std::path::Path>>(context: &Context, path: P)
Err(_err) => {
warn!(
context,
0,
"Cannot read \"{}\" or file is empty.",
path.as_ref().display()
);