433483 sync log initialize
This commit is contained in:
parent
ce5af1d521
commit
15661722b3
|
@ -151,33 +151,32 @@ public class Log
|
||||||
|
|
||||||
public static void initialized()
|
public static void initialized()
|
||||||
{
|
{
|
||||||
|
|
||||||
synchronized (Log.class)
|
synchronized (Log.class)
|
||||||
{
|
{
|
||||||
if (__initialized)
|
if (__initialized)
|
||||||
return;
|
return;
|
||||||
__initialized = true;
|
__initialized = true;
|
||||||
}
|
|
||||||
|
|
||||||
final long uptime=ManagementFactory.getRuntimeMXBean().getUptime();
|
|
||||||
|
|
||||||
try
|
final long uptime=ManagementFactory.getRuntimeMXBean().getUptime();
|
||||||
{
|
|
||||||
Class<?> log_class = Loader.loadClass(Log.class, __logClass);
|
try
|
||||||
if (LOG == null || !LOG.getClass().equals(log_class))
|
|
||||||
{
|
{
|
||||||
LOG = (Logger)log_class.newInstance();
|
Class<?> log_class = Loader.loadClass(Log.class, __logClass);
|
||||||
LOG.debug("Logging to {} via {}", LOG, log_class.getName());
|
if (LOG == null || !LOG.getClass().equals(log_class))
|
||||||
|
{
|
||||||
|
LOG = (Logger)log_class.newInstance();
|
||||||
|
LOG.debug("Logging to {} via {}", LOG, log_class.getName());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
catch(Throwable e)
|
||||||
|
{
|
||||||
|
// Unable to load specified Logger implementation, default to standard logging.
|
||||||
|
initStandardLogging(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (LOG!=null)
|
||||||
|
LOG.info(String.format("Logging initialized @%dms",uptime));
|
||||||
}
|
}
|
||||||
catch(Throwable e)
|
|
||||||
{
|
|
||||||
// Unable to load specified Logger implementation, default to standard logging.
|
|
||||||
initStandardLogging(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (LOG!=null)
|
|
||||||
LOG.info(String.format("Logging initialized @%dms",uptime));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void initStandardLogging(Throwable e)
|
private static void initStandardLogging(Throwable e)
|
||||||
|
|
Loading…
Reference in New Issue