mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
More flexible logger factory access and initialization
This allows to create a logger that wraps the standard IDEA logger (for rdserver)
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
*/
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.openapi.diagnostic;
|
||||
|
||||
import com.intellij.util.ArrayUtil;
|
||||
@@ -52,6 +50,19 @@ public abstract class Logger {
|
||||
}
|
||||
}
|
||||
|
||||
public static void setFactory(Factory factory) {
|
||||
if (isInitialized()) {
|
||||
//noinspection UseOfSystemOutOrSystemErr
|
||||
System.out.println("Changing log factory\n" + ExceptionUtil.getThrowableText(new Throwable()));
|
||||
}
|
||||
|
||||
ourFactory = factory;
|
||||
}
|
||||
|
||||
public static Factory getFactory() {
|
||||
return ourFactory;
|
||||
}
|
||||
|
||||
public static boolean isInitialized() {
|
||||
return !(ourFactory instanceof DefaultFactory);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user