-
-
Save jwne/8e3d8d63443224207bf7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package co.ryred.util; | |
import lombok.Getter; | |
import lombok.Setter; | |
import java.util.logging.Level; | |
import java.util.logging.Logger; | |
/** | |
* Created by Admin on 20/05/2015. | |
*/ | |
public class LogsUtil { | |
@Setter | |
private static Logger logger = Logger.getGlobal(); | |
@Getter | |
@Setter | |
public static boolean debug = true; | |
public static Logger getLogger() { | |
return logger == null ? (logger = Logger.getGlobal()) : logger; | |
} | |
public static boolean _D() { | |
return isDebug(); | |
} | |
public static void _D( Object... objects ) { | |
//if( !isDebug() ) return; | |
StringBuilder sb = new StringBuilder( "[D]" ); | |
for( Object obj : objects ) | |
sb.append( " | " ).append( obj ); | |
log( Level.INFO, sb ); | |
} | |
public static void info( String string ) { | |
getLogger().info( string ); | |
} | |
public static void fine( String string ) { | |
getLogger().fine( string ); | |
} | |
public static void finer( String string ) { | |
getLogger().finer( string ); | |
} | |
public static void finest( String string ) { | |
getLogger().finest( string ); | |
} | |
public static void severe( String string ) { | |
getLogger().severe( string ); | |
} | |
public static void warning( String string ) { | |
getLogger().warning( string ); | |
} | |
public static void log( Level level, Object object ) { | |
getLogger().log( level, object.toString() ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment