File tree 1 file changed +12
-1
lines changed
src/main/java/org/jboss/threads
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 22
22
import java .io .InputStream ;
23
23
import java .io .InputStreamReader ;
24
24
import java .nio .charset .StandardCharsets ;
25
+ import java .security .AccessController ;
26
+ import java .security .PrivilegedAction ;
25
27
import java .util .Properties ;
26
28
27
29
/**
@@ -48,11 +50,20 @@ private Version() {
48
50
}
49
51
JAR_NAME = jarName ;
50
52
VERSION_STRING = versionString ;
51
- try {
53
+ boolean logVersion = AccessController .doPrivileged ((PrivilegedAction <Boolean >) Version ::shouldLogVersion ).booleanValue ();
54
+ if (logVersion ) try {
52
55
Messages .msg .version (versionString );
53
56
} catch (Throwable ignored ) {}
54
57
}
55
58
59
+ private static Boolean shouldLogVersion () {
60
+ try {
61
+ return Boolean .valueOf (System .getProperty ("jboss.log-version" , "true" ));
62
+ } catch (Throwable ignored ) {
63
+ return Boolean .FALSE ;
64
+ }
65
+ }
66
+
56
67
/**
57
68
* Get the name of the JBoss Modules JAR.
58
69
*
You can’t perform that action at this time.
0 commit comments