Udostępnij za pośrednictwem


LogManager.AddLogger(Logger) Method

Definition

Add a named logger.

[Android.Runtime.Register("addLogger", "(Ljava/util/logging/Logger;)Z", "GetAddLogger_Ljava_util_logging_Logger_Handler")]
public virtual bool AddLogger (Java.Util.Logging.Logger? logger);
[<Android.Runtime.Register("addLogger", "(Ljava/util/logging/Logger;)Z", "GetAddLogger_Ljava_util_logging_Logger_Handler")>]
abstract member AddLogger : Java.Util.Logging.Logger -> bool
override this.AddLogger : Java.Util.Logging.Logger -> bool

Parameters

logger
Logger

the new logger.

Returns

true if the argument logger was registered successfully, false if a logger of that name already exists.

Attributes

Remarks

Add a named logger. This does nothing and returns false if a logger with the same name is already registered.

The Logger factory methods call this method to register each newly created Logger.

The application should retain its own reference to the Logger object to avoid it being garbage collected. The LogManager may only retain a weak reference.

Java documentation for java.util.logging.LogManager.addLogger(java.util.logging.Logger).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to