Schema_169: Fix usage of Flogger to log exception stack trace

In the Flogger API, exceptions should be passed via the withCause
builder method, rather than as a vararg. Passing an exception as a
vararg causes Flogger to emit an error when that vararg is not
explicitly consumed by a string format placeholder in the message:

  ERROR: UNUSED LOG ARGUMENTS

As a result, the log does not include the stack trace. See [1] for
example.

Fix the log statement to use withCause(e). At the same time, replace
string concatenation with a vararg for the project name.

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=541221#c67

Change-Id: Idfbb2c56e88054391d03c5248ef28d126e73b338
Bug: Issue 12637
This commit is contained in:
David Pursehouse
2020-04-27 08:43:01 +09:00
parent 25f27acc39
commit c91487abbd

View File

@@ -76,7 +76,7 @@ public class Schema_169 extends SchemaVersion {
skipped += progress.skipped;
} catch (IOException e) {
ok = false;
logger.atWarning().log("Error migrating project " + project, e);
logger.atWarning().withCause(e).log("Error migrating project %s", project);
}
pm.update(1);
}