Class SimpleLogging
A basic logging implementation that sends preformatted output one line at a time to a System.IO.TextWriter, or to any arbitrary output function.
Inheritance
Implements
Namespace: LaunchDarkly.Logging
Assembly: LaunchDarkly.Logging.dll
Syntax
public class SimpleLogging : Object, ILogAdapter
Remarks
This is the configurable adapter that is returned by ToConsole, ToWriter(TextWriter), and ToMethod(Action<String>). You can specify additional options using the methods of this class, such as DateFormat(String).
Fields
DefaultDateFormat
The default format for log timestamps.
Declaration
public const string DefaultDateFormat = "yyyy-MM-dd HH:mm:ss.fff zzz"
Field Value
Type | Description |
---|---|
System.String |
Methods
DateFormat(String)
Specifies the format for date/timestamps, in the syntax used by System.DateTime.ToString(System.String).
Declaration
public SimpleLogging DateFormat(string dateFormat)
Parameters
Type | Name | Description |
---|---|---|
System.String | dateFormat | the date/time format, or null to omit the date and time |
Returns
Type | Description |
---|---|
SimpleLogging | an adapter with the specified configuration |
Remarks
This method does not modify the current instance, but returns a new adapter based on this one.
NewChannel(String)
Called internally by the logging framework.
Declaration
public IChannel NewChannel(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | the channel name |
Returns
Type | Description |
---|---|
IChannel | a new channel |