File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
src/main/java/org/scijava/log Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change 3838import org .scijava .service .AbstractService ;
3939
4040/**
41- * Base class for {@link LogService} implementationst .
41+ * Base class for {@link LogService} implementations .
4242 *
4343 * @author Johannes Schindelin
4444 */
4545public abstract class AbstractLogService extends AbstractService implements
4646 LogService
4747{
4848
49- private int currentLevel = System . getenv ( "DEBUG" ) == null ? INFO : DEBUG ;
49+ private int currentLevel = levelFromEnvironment () ;
5050
5151 private final Map <String , Integer > classAndPackageLevels =
5252 new HashMap <>();
@@ -77,10 +77,8 @@ public AbstractLogService() {
7777 final int level = level (logProp );
7878 if (level >= 0 ) setLevel (level );
7979
80- if (getLevel () == 0 ) {
81- // use the default, which is WARN unless the DEBUG env. variable is set
82- setLevel (System .getenv ("DEBUG" ) == null ? INFO : DEBUG );
83- }
80+ if (getLevel () == 0 )
81+ setLevel (levelFromEnvironment ());
8482
8583 // populate custom class- and package-specific log level properties
8684 final String logLevelPrefix = LOG_LEVEL_PROPERTY + ":" ;
@@ -297,4 +295,9 @@ private String parentPackage(final String classOrPackageName) {
297295 return classOrPackageName .substring (0 , dot );
298296 }
299297
298+ private int levelFromEnvironment () {
299+ // use the default, which is INFO unless the DEBUG env. variable is set
300+ return System .getenv ("DEBUG" ) == null ? INFO : DEBUG ;
301+ }
302+
300303}
You can’t perform that action at this time.
0 commit comments