[geary] Mark Geary.Logging log calls as printf-format, fix the resulting issues.
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary] Mark Geary.Logging log calls as printf-format, fix the resulting issues.
- Date: Mon, 18 Dec 2017 03:50:22 +0000 (UTC)
commit 6097b0a78f8f759c261a6abd4ab8ef406624590c
Author: Michael James Gratton <mike vee net>
Date: Mon Dec 18 13:55:39 2017 +1100
Mark Geary.Logging log calls as printf-format, fix the resulting issues.
src/engine/api/geary-logging.vala | 5 +++++
.../imap-engine/imap-engine-replay-queue.vala | 12 ++++++++----
src/engine/imap/transport/imap-deserializer.vala | 6 +++++-
src/engine/smtp/smtp-client-connection.vala | 6 +++---
4 files changed, 21 insertions(+), 8 deletions(-)
---
diff --git a/src/engine/api/geary-logging.vala b/src/engine/api/geary-logging.vala
index b218ccd..e09dfac 100644
--- a/src/engine/api/geary-logging.vala
+++ b/src/engine/api/geary-logging.vala
@@ -89,26 +89,31 @@ public inline bool are_all_flags_set(Flag flags) {
return logging_flags.is_all_set(flags);
}
+[PrintfFormat]
public inline void error(Flag flags, string fmt, ...) {
if (logging_flags.is_any_set(flags))
logv(DOMAIN, LogLevelFlags.LEVEL_ERROR, fmt, va_list());
}
+[PrintfFormat]
public inline void critical(Flag flags, string fmt, ...) {
if (logging_flags.is_any_set(flags))
logv(DOMAIN, LogLevelFlags.LEVEL_CRITICAL, fmt, va_list());
}
+[PrintfFormat]
public inline void warning(Flag flags, string fmt, ...) {
if (logging_flags.is_any_set(flags))
logv(DOMAIN, LogLevelFlags.LEVEL_WARNING, fmt, va_list());
}
+[PrintfFormat]
public inline void message(Flag flags, string fmt, ...) {
if (logging_flags.is_any_set(flags))
logv(DOMAIN, LogLevelFlags.LEVEL_MESSAGE, fmt, va_list());
}
+[PrintfFormat]
public inline void debug(Flag flags, string fmt, ...) {
if (logging_flags.is_any_set(flags)) {
logv(DOMAIN, LogLevelFlags.LEVEL_DEBUG, fmt, va_list());
diff --git a/src/engine/imap-engine/imap-engine-replay-queue.vala
b/src/engine/imap-engine/imap-engine-replay-queue.vala
index be4056f..4ebf8b3 100644
--- a/src/engine/imap-engine/imap-engine-replay-queue.vala
+++ b/src/engine/imap-engine/imap-engine-replay-queue.vala
@@ -64,12 +64,16 @@ private class Geary.ImapEngine.ReplayQueue : Geary.BaseObject {
private Scheduler.Scheduled? notification_timer = null;
private int64 next_submission_number = 0;
private State state = State.OPEN;
-
+
public virtual signal void scheduled(ReplayOperation op) {
- Logging.debug(Logging.Flag.REPLAY, "[%s] ReplayQueue::scheduled: %s %s", to_string(),
- op.to_string());
+ Logging.debug(
+ Logging.Flag.REPLAY,
+ "[%s] ReplayQueue::scheduled: %s",
+ to_string(),
+ op.to_string()
+ );
}
-
+
public virtual signal void locally_executing(ReplayOperation op) {
Logging.debug(Logging.Flag.REPLAY, "[%s] ReplayQueue::locally-executing: %s", to_string(),
op.to_string());
diff --git a/src/engine/imap/transport/imap-deserializer.vala
b/src/engine/imap/transport/imap-deserializer.vala
index 67e09c7..f6f107d 100644
--- a/src/engine/imap/transport/imap-deserializer.vala
+++ b/src/engine/imap/transport/imap-deserializer.vala
@@ -484,7 +484,11 @@ public class Geary.Imap.Deserializer : BaseObject {
private void flush_params() {
bool okay = true;
if (this.context != this.root) {
- Logging.debug(Logging.Flag.DESERIALIZER, "[%s] Unclosed list in parameters");
+ Logging.debug(
+ Logging.Flag.DESERIALIZER,
+ "[%s] Unclosed list in parameters",
+ to_string()
+ );
okay = false;
}
diff --git a/src/engine/smtp/smtp-client-connection.vala b/src/engine/smtp/smtp-client-connection.vala
index 71cab8f..26074ab 100644
--- a/src/engine/smtp/smtp-client-connection.vala
+++ b/src/engine/smtp/smtp-client-connection.vala
@@ -118,9 +118,9 @@ public class Geary.Smtp.ClientConnection {
Response response = yield transaction_async(new Request(Command.DATA), cancellable);
if (!response.code.is_start_data())
return response;
-
- Logging.debug(Logging.Flag.NETWORK, "[%s] SMTP Data: <%ldb>", to_string(), data.size);
-
+
+ Logging.debug(Logging.Flag.NETWORK, "[%s] SMTP Data: <%z>", to_string(), data.size);
+
if (!already_dotstuffed) {
// By using DataStreamNewlineType.ANY, we're assured to get each line and convert to
// a proper line terminator for SMTP
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]