• Articles
  • Api Documentation
Show / Hide Table of Contents
  • Dapplo.Log
    • AbstractLogger
    • ILogger
    • ILoggerConfiguration
    • LoggerMapper
    • LogInfo
    • LogInfoExtensions
    • LogLevels
    • LogSettings
    • LogSource
    • LogSourceExtensions
    • NullLogger
  • Dapplo.Log.LogFile
    • FileLogger
    • ForwardingLogger
    • IFileLoggerConfiguration
  • Dapplo.Log.Loggers
    • ColorConsoleLogger
    • ConsoleLogger
    • DebugLogger
    • StringWriterLogger
    • TraceLogger
  • Dapplo.Log.XUnit
    • XUnitLogger

Class LogSource

This defines the "source" (origin) for log statements, it should have a Type or a identifier (string) so it's clear where the log entries come from. In general this should be instanciated with the default constructor without arguments, which takes care of initiating it. For normal .NET 4.5 this uses the Stack to find the type which called the constructor. For other platforms this uses the CallerFilePath, which supplies the source-file.

Inheritance
System.Object
LogSource
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace:Dapplo.Log
Assembly:Dapplo.Log.dll
Syntax
public class LogSource

Constructors

| Improve this Doc View Source

LogSource(String)

The NON desktop default constructor which should be called without an argument. It will use the CallerFilePath attribute, to make sure the source file is passed as an argument.

Declaration
public LogSource(string sourceFilePath = null)
Parameters
Type Name Description
System.String sourceFilePath
| Improve this Doc View Source

LogSource(Type)

The constructor for specifying the type manually

Declaration
public LogSource(Type callerType)
Parameters
Type Name Description
System.Type callerType

Type for the LogSource, not null

Properties

| Improve this Doc View Source

ShortSource

The Type, as string, where this LogSource was created Every part of the namespace is shortened to one letter. e.g. this class would return d.l.LogSource

Declaration
public string ShortSource { get; set; }
Property Value
Type Description
System.String
| Improve this Doc View Source

Source

The Type, as string, where this LogSource was created e.g. this class would return Dapplo.Log.LogSource

Declaration
public string Source { get; set; }
Property Value
Type Description
System.String
| Improve this Doc View Source

SourceType

The Type where this LogSource was created

Declaration
public Type SourceType { get; }
Property Value
Type Description
System.Type

Methods

| Improve this Doc View Source

ForCustomSource(String)

Factory method where you can specify the type manually

Declaration
public static LogSource ForCustomSource(string source)
Parameters
Type Name Description
System.String source

A custom identifier for the LogSource

Returns
Type Description
LogSource

LogSource

Extension Methods

LoggerMapper.Loggers(LogSource)
LoggerMapper.LogTo(LogSource, ILogger)
LogSourceExtensions.IsDebugEnabled(LogSource)
LogSourceExtensions.IsErrorEnabled(LogSource)
LogSourceExtensions.IsFatalEnabled(LogSource)
LogSourceExtensions.IsInfoEnabled(LogSource)
LogSourceExtensions.IsVerboseEnabled(LogSource)
LogSourceExtensions.IsWarnEnabled(LogSource)
LogSourceExtensions.Debug(LogSource, Int32, String)
LogSourceExtensions.Error(LogSource, Int32, String)
LogSourceExtensions.Fatal(LogSource, Int32, String)
LogSourceExtensions.Info(LogSource, Int32, String)
LogSourceExtensions.Verbose(LogSource, Int32, String)
LogSourceExtensions.Warn(LogSource, Int32, String)
  • Improve this Doc
  • View Source
Back to top Copyright © 2017 Dapplo