[jOOQ/jOOQ#12405] CLI programs should set java.util.loggin.SimpleFormatter.format if not already set
This commit is contained in:
parent
8bbf080a87
commit
0d7eb1748f
@ -150,6 +150,7 @@ public class GenerationTool {
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
JooqLogger.initSimpleFormatter();
|
||||
String[] files;
|
||||
|
||||
if (args.length > 0) {
|
||||
|
||||
@ -39,6 +39,8 @@ package org.jooq;
|
||||
|
||||
import static org.jooq.Constants.MINOR_VERSION;
|
||||
|
||||
import org.jooq.tools.JooqLogger;
|
||||
|
||||
/**
|
||||
* Common utilities for {@link ParserCLI}, {@link DiffCLI} and others.
|
||||
*
|
||||
@ -47,6 +49,8 @@ import static org.jooq.Constants.MINOR_VERSION;
|
||||
final class CLIUtil {
|
||||
|
||||
static void main(String url, Runnable runnable) {
|
||||
JooqLogger.initSimpleFormatter();
|
||||
|
||||
try {
|
||||
runnable.run();
|
||||
}
|
||||
|
||||
@ -37,6 +37,8 @@
|
||||
*/
|
||||
package org.jooq.tools;
|
||||
|
||||
import java.util.logging.SimpleFormatter;
|
||||
|
||||
import org.jooq.Log;
|
||||
|
||||
/**
|
||||
@ -596,4 +598,13 @@ public final class JooqLogger implements Log {
|
||||
return ordinal() <= level.ordinal();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* [#12405] The common {@link SimpleFormatter} format to be set in all of
|
||||
* jOOQ's CLIs.
|
||||
*/
|
||||
public static void initSimpleFormatter() {
|
||||
if (System.getProperty("java.util.logging.SimpleFormatter.format") == null)
|
||||
System.setProperty("java.util.logging.SimpleFormatter.format", "%1$tH:%1$tM:%1$tS %4$s %5$s%6$s%n");
|
||||
}
|
||||
}
|
||||
|
||||
@ -57,7 +57,6 @@ import java.lang.reflect.ParameterizedType;
|
||||
import java.net.URL;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.IdentityHashMap;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user