다음을 통해 공유


Logger.Log Method

Definition

Overloads

Log(Level, String, Object[])

Log a message, with an array of object arguments.

Log(Level, String, Throwable)

Log a message, with associated Throwable information.

Log(Level, String, Object)

Log a message, with one object parameter.

Log(Level, ISupplier)

Log a message, which is only to be constructed if the logging level is such that the message will actually be logged.

Log(Level, String)

Log a message, with no arguments.

Log(LogRecord)

Log a LogRecord.

Log(Level, Throwable, ISupplier)

Log a lazily constructed message, with associated Throwable information.

Log(Level, String, Object[])

Log a message, with an array of object arguments.

[Android.Runtime.Register("log", "(Ljava/util/logging/Level;Ljava/lang/String;[Ljava/lang/Object;)V", "GetLog_Ljava_util_logging_Level_Ljava_lang_String_arrayLjava_lang_Object_Handler")]
public virtual void Log (Java.Util.Logging.Level level, string? msg, Java.Lang.Object[]? params);
[<Android.Runtime.Register("log", "(Ljava/util/logging/Level;Ljava/lang/String;[Ljava/lang/Object;)V", "GetLog_Ljava_util_logging_Level_Ljava_lang_String_arrayLjava_lang_Object_Handler")>]
abstract member Log : Java.Util.Logging.Level * string * Java.Lang.Object[] -> unit
override this.Log : Java.Util.Logging.Level * string * Java.Lang.Object[] -> unit

Parameters

level
Level

One of the message level identifiers, e.g., SEVERE

msg
String

The string message (or a key in the message catalog)

params
Object[]

array of parameters to the message

Attributes

Remarks

Log a message, with an array of object arguments.

If the logger is currently enabled for the given message level then a corresponding LogRecord is created and forwarded to all the registered output Handler objects.

Java documentation for java.util.logging.Logger.log(java.util.logging.Level, java.lang.String, java.lang.Object[]).

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

Log(Level, String, Throwable)

Log a message, with associated Throwable information.

[Android.Runtime.Register("log", "(Ljava/util/logging/Level;Ljava/lang/String;Ljava/lang/Throwable;)V", "GetLog_Ljava_util_logging_Level_Ljava_lang_String_Ljava_lang_Throwable_Handler")]
public virtual void Log (Java.Util.Logging.Level level, string? msg, Java.Lang.Throwable? thrown);
[<Android.Runtime.Register("log", "(Ljava/util/logging/Level;Ljava/lang/String;Ljava/lang/Throwable;)V", "GetLog_Ljava_util_logging_Level_Ljava_lang_String_Ljava_lang_Throwable_Handler")>]
abstract member Log : Java.Util.Logging.Level * string * Java.Lang.Throwable -> unit
override this.Log : Java.Util.Logging.Level * string * Java.Lang.Throwable -> unit

Parameters

level
Level

One of the message level identifiers, e.g., SEVERE

msg
String

The string message (or a key in the message catalog)

thrown
Throwable

Throwable associated with log message.

Attributes

Remarks

Log a message, with associated Throwable information.

If the logger is currently enabled for the given message level then the given arguments are stored in a LogRecord which is forwarded to all registered output handlers.

Note that the thrown argument is stored in the LogRecord thrown property, rather than the LogRecord parameters property. Thus it is processed specially by output Formatters and is not treated as a formatting parameter to the LogRecord message property.

Java documentation for java.util.logging.Logger.log(java.util.logging.Level, java.lang.String, java.lang.Throwable).

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

Log(Level, String, Object)

Log a message, with one object parameter.

[Android.Runtime.Register("log", "(Ljava/util/logging/Level;Ljava/lang/String;Ljava/lang/Object;)V", "GetLog_Ljava_util_logging_Level_Ljava_lang_String_Ljava_lang_Object_Handler")]
public virtual void Log (Java.Util.Logging.Level level, string? msg, Java.Lang.Object? param1);
[<Android.Runtime.Register("log", "(Ljava/util/logging/Level;Ljava/lang/String;Ljava/lang/Object;)V", "GetLog_Ljava_util_logging_Level_Ljava_lang_String_Ljava_lang_Object_Handler")>]
abstract member Log : Java.Util.Logging.Level * string * Java.Lang.Object -> unit
override this.Log : Java.Util.Logging.Level * string * Java.Lang.Object -> unit

Parameters

level
Level

One of the message level identifiers, e.g., SEVERE

msg
String

The string message (or a key in the message catalog)

param1
Object

parameter to the message

Attributes

Remarks

Log a message, with one object parameter.

If the logger is currently enabled for the given message level then a corresponding LogRecord is created and forwarded to all the registered output Handler objects.

Java documentation for java.util.logging.Logger.log(java.util.logging.Level, java.lang.String, java.lang.Object).

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

Log(Level, ISupplier)

Log a message, which is only to be constructed if the logging level is such that the message will actually be logged.

[Android.Runtime.Register("log", "(Ljava/util/logging/Level;Ljava/util/function/Supplier;)V", "GetLog_Ljava_util_logging_Level_Ljava_util_function_Supplier_Handler", ApiSince=26)]
public virtual void Log (Java.Util.Logging.Level level, Java.Util.Functions.ISupplier msgSupplier);
[<Android.Runtime.Register("log", "(Ljava/util/logging/Level;Ljava/util/function/Supplier;)V", "GetLog_Ljava_util_logging_Level_Ljava_util_function_Supplier_Handler", ApiSince=26)>]
abstract member Log : Java.Util.Logging.Level * Java.Util.Functions.ISupplier -> unit
override this.Log : Java.Util.Logging.Level * Java.Util.Functions.ISupplier -> unit

Parameters

level
Level

One of the message level identifiers, e.g., SEVERE

msgSupplier
ISupplier

A function, which when called, produces the desired log message

Attributes

Remarks

Log a message, which is only to be constructed if the logging level is such that the message will actually be logged.

If the logger is currently enabled for the given message level then the message is constructed by invoking the provided supplier function and forwarded to all the registered output Handler objects.

Added in 1.8.

Java documentation for java.util.logging.Logger.log(java.util.logging.Level, java.util.function.Supplier<java.lang.String>).

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

Log(Level, String)

Log a message, with no arguments.

[Android.Runtime.Register("log", "(Ljava/util/logging/Level;Ljava/lang/String;)V", "GetLog_Ljava_util_logging_Level_Ljava_lang_String_Handler")]
public virtual void Log (Java.Util.Logging.Level level, string? msg);
[<Android.Runtime.Register("log", "(Ljava/util/logging/Level;Ljava/lang/String;)V", "GetLog_Ljava_util_logging_Level_Ljava_lang_String_Handler")>]
abstract member Log : Java.Util.Logging.Level * string -> unit
override this.Log : Java.Util.Logging.Level * string -> unit

Parameters

level
Level

One of the message level identifiers, e.g., SEVERE

msg
String

The string message (or a key in the message catalog)

Attributes

Remarks

Log a message, with no arguments.

If the logger is currently enabled for the given message level then the given message is forwarded to all the registered output Handler objects.

Java documentation for java.util.logging.Logger.log(java.util.logging.Level, java.lang.String).

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

Log(LogRecord)

Log a LogRecord.

[Android.Runtime.Register("log", "(Ljava/util/logging/LogRecord;)V", "GetLog_Ljava_util_logging_LogRecord_Handler")]
public virtual void Log (Java.Util.Logging.LogRecord record);
[<Android.Runtime.Register("log", "(Ljava/util/logging/LogRecord;)V", "GetLog_Ljava_util_logging_LogRecord_Handler")>]
abstract member Log : Java.Util.Logging.LogRecord -> unit
override this.Log : Java.Util.Logging.LogRecord -> unit

Parameters

record
LogRecord

the LogRecord to be published

Attributes

Remarks

Log a LogRecord.

All the other logging methods in this class call through this method to actually perform any logging. Subclasses can override this single method to capture all log activity.

Java documentation for java.util.logging.Logger.log(java.util.logging.LogRecord).

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

Log(Level, Throwable, ISupplier)

Log a lazily constructed message, with associated Throwable information.

[Android.Runtime.Register("log", "(Ljava/util/logging/Level;Ljava/lang/Throwable;Ljava/util/function/Supplier;)V", "GetLog_Ljava_util_logging_Level_Ljava_lang_Throwable_Ljava_util_function_Supplier_Handler", ApiSince=26)]
public virtual void Log (Java.Util.Logging.Level level, Java.Lang.Throwable? thrown, Java.Util.Functions.ISupplier msgSupplier);
[<Android.Runtime.Register("log", "(Ljava/util/logging/Level;Ljava/lang/Throwable;Ljava/util/function/Supplier;)V", "GetLog_Ljava_util_logging_Level_Ljava_lang_Throwable_Ljava_util_function_Supplier_Handler", ApiSince=26)>]
abstract member Log : Java.Util.Logging.Level * Java.Lang.Throwable * Java.Util.Functions.ISupplier -> unit
override this.Log : Java.Util.Logging.Level * Java.Lang.Throwable * Java.Util.Functions.ISupplier -> unit

Parameters

level
Level

One of the message level identifiers, e.g., SEVERE

thrown
Throwable

Throwable associated with log message.

msgSupplier
ISupplier

A function, which when called, produces the desired log message

Attributes

Remarks

Log a lazily constructed message, with associated Throwable information.

If the logger is currently enabled for the given message level then the message is constructed by invoking the provided supplier function. The message and the given Throwable are then stored in a LogRecord which is forwarded to all registered output handlers.

Note that the thrown argument is stored in the LogRecord thrown property, rather than the LogRecord parameters property. Thus it is processed specially by output Formatters and is not treated as a formatting parameter to the LogRecord message property.

Added in 1.8.

Java documentation for java.util.logging.Logger.log(java.util.logging.Level, java.lang.Throwable, java.util.function.Supplier<java.lang.String>).

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