Represents a logging helper class.

Namespace: Hypertable
Assembly: ht4n (in ht4n.dll) Version: 0.9.8.11 (0.9.8.11)

Syntax

         
 C#  Visual Basic  Visual C++ 
public static class Logging
Public NotInheritable Class Logging
public ref class Logging abstract sealed

Members

         
 All Members  Properties   Methods  
 Public

 Protected
 Instance

 Static 
 Declared

 Inherited
 XNA Framework Only 

 .NET Compact Framework Only 

 MemberDescription
IsEnabled(TraceEventType)
Determines whether the trace listener should trace the event of the type specified.
Logfile
Gets or sets the logfile to be used.
LogMessagePublished
Gets or sets the log message published delegate.
TraceEvent(TraceEventType, Func<(Of <<'(String>)>>))
Writes a trace event to the trace listeners in the trace source listener collection using the specified event type and message.
TraceEvent(TraceEventType, String)
Writes a trace event to the trace listeners in the trace source listener collection using the specified event type and message.
TraceException(Exception)
Writes a error event to the trace listeners in the trace source listener collection using the specified event type and message.
TraceSource
Gets or sets the trace source to be used.

Examples

Routing ht4n logs through NLog
CopyC#
<system.diagnostics>
  <trace autoflush="true" />
  <sources>
    <source name="ht4n" switchValue="All">
      <listeners>
        <clear/>
        <add name="nlog" />
      </listeners>
    </source>
  </sources>
  <sharedListeners>
    <add name="nlog" type="NLog.NLogTraceListener, NLog" />
  </sharedListeners>
</system.diagnostics>
The following example shows how to use a logfile.
CopyC#
Logging.Logfile = Assembly.GetAssembly(typeof(Program)).Location + ".log";
The following example shows how to trace log entries.
CopyC#
Logging.LogMessagePublished = message => System.Diagnostics.Trace.WriteLine(message);

Inheritance Hierarchy

System..::..Object
  Hypertable..::..Logging

See Also