Search Results for

    Show / Hide Table of Contents

    Class FluentMigratorLogger

    The base class for FluentMigrator-style ILogger implementations

    Inheritance
    object
    FluentMigratorLogger
    AnnouncerFluentMigratorLogger
    FluentMigratorRunnerLogger
    Implements
    ILogger
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: FluentMigrator.Runner.Logging
    Assembly: FluentMigrator.Runner.Core.dll
    Syntax
    public abstract class FluentMigratorLogger : ILogger

    Constructors

    | Edit this page View Source

    FluentMigratorLogger(FluentMigratorLoggerOptions)

    Initializes a new instance of the FluentMigratorLogger class.

    Declaration
    protected FluentMigratorLogger(FluentMigratorLoggerOptions options)
    Parameters
    Type Name Description
    FluentMigratorLoggerOptions options

    The logger options

    Methods

    | Edit this page View Source

    BeginScope<TState>(TState)

    Begins a logical operation scope.

    Declaration
    public IDisposable BeginScope<TState>(TState state)
    Parameters
    Type Name Description
    TState state

    The identifier for the scope.

    Returns
    Type Description
    IDisposable

    An IDisposable that ends the logical operation scope on dispose.

    Type Parameters
    Name Description
    TState
    | Edit this page View Source

    IsEnabled(LogLevel)

    Checks if the given logLevel is enabled.

    Declaration
    public bool IsEnabled(LogLevel logLevel)
    Parameters
    Type Name Description
    LogLevel logLevel

    level to be checked.

    Returns
    Type Description
    bool

    true if enabled.

    | Edit this page View Source

    Log<TState>(LogLevel, EventId, TState, Exception, Func<TState, Exception, string>)

    Writes a log entry.

    Declaration
    public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
    Parameters
    Type Name Description
    LogLevel logLevel

    Entry will be written on this level.

    EventId eventId

    Id of the event.

    TState state

    The entry to be written. Can be also an object.

    Exception exception

    The exception related to this entry.

    Func<TState, Exception, string> formatter

    Function to create a string message of the state and exception.

    Type Parameters
    Name Description
    TState
    | Edit this page View Source

    WriteElapsedTime(TimeSpan)

    Writes the elapsed time

    Declaration
    protected abstract void WriteElapsedTime(TimeSpan timeSpan)
    Parameters
    Type Name Description
    TimeSpan timeSpan

    The elapsed time

    | Edit this page View Source

    WriteEmphasize(string)

    Writes an emphasized text

    Declaration
    protected abstract void WriteEmphasize(string message)
    Parameters
    Type Name Description
    string message

    The message to write

    | Edit this page View Source

    WriteEmptySql()

    Called when an attempt was made to write an empty SQL statement

    Declaration
    protected abstract void WriteEmptySql()
    | Edit this page View Source

    WriteError(Exception)

    Writes an exception message

    Declaration
    protected abstract void WriteError(Exception exception)
    Parameters
    Type Name Description
    Exception exception

    The exception containing the message

    | Edit this page View Source

    WriteError(string)

    Writes an error message

    Declaration
    protected abstract void WriteError(string message)
    Parameters
    Type Name Description
    string message

    The error message

    | Edit this page View Source

    WriteHeading(string)

    Writes a heading

    Declaration
    protected abstract void WriteHeading(string message)
    Parameters
    Type Name Description
    string message

    The heading message

    | Edit this page View Source

    WriteSay(string)

    Writes a message

    Declaration
    protected abstract void WriteSay(string message)
    Parameters
    Type Name Description
    string message

    The message

    | Edit this page View Source

    WriteSql(string)

    Writes an SQL statement

    Declaration
    protected abstract void WriteSql(string sql)
    Parameters
    Type Name Description
    string sql

    The SQL statement

    Implements

    ILogger

    Extension Methods

    LoggingUtilities.LogElapsedTime(ILogger, TimeSpan)
    LoggingUtilities.LogEmphasized(ILogger, string)
    LoggingUtilities.LogHeader(ILogger, string)
    LoggingUtilities.LogSay(ILogger, string)
    LoggingUtilities.LogSql(ILogger, string)
    • Edit this page
    • View Source
    In this article
    Back to top
    Copyright © 2018 Fluent Migrator Project
    Generated by DocFX
    Creative Commons License
    FluentMigrator Documentation by FluentMigrator Project is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.