Skip to content

Commit 2f06933

Browse files
committed
use SLF4J formatter
1 parent 97472ca commit 2f06933

File tree

4 files changed

+736
-737
lines changed

4 files changed

+736
-737
lines changed

slf4j-simple/src/main/java/org/slf4j/impl/OutputChoice.java

+41-41
Original file line numberDiff line numberDiff line change
@@ -10,46 +10,46 @@
1010
*/
1111
class OutputChoice {
1212

13-
enum OutputChoiceType {
14-
SYS_OUT, CACHED_SYS_OUT, SYS_ERR, CACHED_SYS_ERR, FILE;
15-
}
16-
17-
final OutputChoiceType outputChoiceType;
18-
final PrintStream targetPrintStream;
19-
20-
OutputChoice(OutputChoiceType outputChoiceType) {
21-
if (outputChoiceType == OutputChoiceType.FILE) {
22-
throw new IllegalArgumentException();
23-
}
24-
this.outputChoiceType = outputChoiceType;
25-
if (outputChoiceType == OutputChoiceType.CACHED_SYS_OUT) {
26-
this.targetPrintStream = System.out;
27-
} else if (outputChoiceType == OutputChoiceType.CACHED_SYS_ERR) {
28-
this.targetPrintStream = System.err;
29-
} else {
30-
this.targetPrintStream = null;
31-
}
32-
}
33-
34-
OutputChoice(PrintStream printStream) {
35-
this.outputChoiceType = OutputChoiceType.FILE;
36-
this.targetPrintStream = printStream;
37-
}
38-
39-
PrintStream getTargetPrintStream() {
40-
switch (outputChoiceType) {
41-
case SYS_OUT:
42-
return System.out;
43-
case SYS_ERR:
44-
return System.err;
45-
case CACHED_SYS_ERR:
46-
case CACHED_SYS_OUT:
47-
case FILE:
48-
return targetPrintStream;
49-
default:
50-
throw new IllegalArgumentException();
51-
}
52-
53-
}
13+
enum OutputChoiceType {
14+
SYS_OUT, CACHED_SYS_OUT, SYS_ERR, CACHED_SYS_ERR, FILE;
15+
}
16+
17+
final OutputChoiceType outputChoiceType;
18+
final PrintStream targetPrintStream;
19+
20+
OutputChoice(OutputChoiceType outputChoiceType) {
21+
if (outputChoiceType == OutputChoiceType.FILE) {
22+
throw new IllegalArgumentException();
23+
}
24+
this.outputChoiceType = outputChoiceType;
25+
if (outputChoiceType == OutputChoiceType.CACHED_SYS_OUT) {
26+
this.targetPrintStream = System.out;
27+
} else if (outputChoiceType == OutputChoiceType.CACHED_SYS_ERR) {
28+
this.targetPrintStream = System.err;
29+
} else {
30+
this.targetPrintStream = null;
31+
}
32+
}
33+
34+
OutputChoice(PrintStream printStream) {
35+
this.outputChoiceType = OutputChoiceType.FILE;
36+
this.targetPrintStream = printStream;
37+
}
38+
39+
PrintStream getTargetPrintStream() {
40+
switch (outputChoiceType) {
41+
case SYS_OUT:
42+
return System.out;
43+
case SYS_ERR:
44+
return System.err;
45+
case CACHED_SYS_ERR:
46+
case CACHED_SYS_OUT:
47+
case FILE:
48+
return targetPrintStream;
49+
default:
50+
throw new IllegalArgumentException();
51+
}
52+
53+
}
5454

5555
}

0 commit comments

Comments
 (0)