LoggingFacade:

- make LoggingFacadeImpl classes package private
- added missing @Override
- minor formatting changes
This commit is contained in:
Karl Tauber
2021-03-12 21:16:57 +01:00
parent 712bff9c99
commit 617a35c51b
4 changed files with 13 additions and 9 deletions

View File

@@ -253,11 +253,10 @@ class UIDefaultsLoader
static void logParseError( String key, String value, RuntimeException ex, boolean severe ) { static void logParseError( String key, String value, RuntimeException ex, boolean severe ) {
String message = "FlatLaf: Failed to parse: '" + key + '=' + value + '\''; String message = "FlatLaf: Failed to parse: '" + key + '=' + value + '\'';
if (severe) { if( severe )
LoggingFacade.INSTANCE.logSevere( message, ex ); LoggingFacade.INSTANCE.logSevere( message, ex );
} else { else
LoggingFacade.INSTANCE.logConfig( message, ex ); LoggingFacade.INSTANCE.logConfig( message, ex );
}
} }
static String resolveValue( String value, Function<String, String> propertiesGetter ) { static String resolveValue( String value, Function<String, String> propertiesGetter ) {

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2020 FormDev Software GmbH * Copyright 2021 FormDev Software GmbH
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -21,6 +21,5 @@ public interface LoggingFacade
LoggingFacade INSTANCE = new LoggingFacadeImpl(); LoggingFacade INSTANCE = new LoggingFacadeImpl();
void logSevere( String message, Throwable t ); void logSevere( String message, Throwable t );
void logConfig( String message, Throwable t ); void logConfig( String message, Throwable t );
} }

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2020 FormDev Software GmbH * Copyright 2021 FormDev Software GmbH
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -20,14 +20,17 @@ import com.formdev.flatlaf.FlatLaf;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
public class LoggingFacadeImpl implements LoggingFacade class LoggingFacadeImpl
implements LoggingFacade
{ {
private static final Logger LOG = Logger.getLogger( FlatLaf.class.getName() ); private static final Logger LOG = Logger.getLogger( FlatLaf.class.getName() );
@Override
public void logSevere( String message, Throwable t ) { public void logSevere( String message, Throwable t ) {
LOG.log( Level.SEVERE, message, t ); LOG.log( Level.SEVERE, message, t );
} }
@Override
public void logConfig( String message, Throwable t ) { public void logConfig( String message, Throwable t ) {
LOG.log( Level.CONFIG, message, t ); LOG.log( Level.CONFIG, message, t );
} }

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2020 FormDev Software GmbH * Copyright 2021 FormDev Software GmbH
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -18,14 +18,17 @@ package com.formdev.flatlaf.util;
import com.formdev.flatlaf.FlatLaf; import com.formdev.flatlaf.FlatLaf;
public class LoggingFacadeImpl implements LoggingFacade class LoggingFacadeImpl
implements LoggingFacade
{ {
private static final System.Logger LOG = System.getLogger( FlatLaf.class.getName() ); private static final System.Logger LOG = System.getLogger( FlatLaf.class.getName() );
@Override
public void logSevere( String message, Throwable t ) { public void logSevere( String message, Throwable t ) {
LOG.log( System.Logger.Level.ERROR, message, t ); LOG.log( System.Logger.Level.ERROR, message, t );
} }
@Override
public void logConfig( String message, Throwable t ) { public void logConfig( String message, Throwable t ) {
LOG.log( System.Logger.Level.DEBUG, message, t ); LOG.log( System.Logger.Level.DEBUG, message, t );
} }