Skip to content

0b96cc2e abf9 9fdb 0c39 2f4dba079b7d

Axel Kesseler edited this page Mar 1, 2023 · 2 revisions

LogLevelMessageExtension Class

This extension represents a set of convenience methods for an easier access of Message logging messages.

Inheritance Hierarchy

System.Object
  Plexdata.LogWriter.Extensions.LogLevelMessageExtension
Namespace: Plexdata.LogWriter.Extensions
Assembly: Plexdata.LogWriter.Abstraction (in Plexdata.LogWriter.Abstraction.dll) Version: 1.0.7.1

Syntax

C#

public static class LogLevelMessageExtension

Methods

 

Name Description
Public methodStatic member Message(ILogger, Exception) This method writes the exception into the logger using Message as logging level.
Public methodStatic member Message(ILogger, String) This method writes the message into the logger using Message as logging level.
Public methodStatic member Message(ILogger, Exception, ValueTuple(String, Object)[]) This method writes the exception into the logger using Message as logging level.
Public methodStatic member Message(ILogger, String, Exception) This method writes the message and the exception into the logger using Message as logging level.
Public methodStatic member Message(ILogger, String, ValueTuple(String, Object)[]) This method writes the message into the logger using Message as logging level.
Public methodStatic member Message(ILogger, String, Exception, ValueTuple(String, Object)[]) This method writes the message and the exception into the logger using Message as logging level.
Public methodStatic member Message(TContext)(ILogger(TContext), Exception) This method writes the exception for current TContext into the logger using Message as logging level.
Public methodStatic member Message(TContext)(ILogger(TContext), String) This method writes the message for current TContext into the logger using Message as logging level.
Public methodStatic member Message(TScope)(ILogger, TScope, Exception) This method writes the exception for provided scope into the logger using Message as logging level.
Public methodStatic member Message(TScope)(ILogger, TScope, String) This method writes the message for provided scope into the logger using Message as logging level.
Public methodStatic member Message(TContext)(ILogger(TContext), Exception, ValueTuple(String, Object)[]) This method writes the exception for current TContext into the logger using Message as logging level.
Public methodStatic member Message(TContext)(ILogger(TContext), String, Exception) This method writes the message and the exception for current TContext into the logger using Message as logging level.
Public methodStatic member Message(TContext)(ILogger(TContext), String, ValueTuple(String, Object)[]) This method writes the message for current TContext into the logger using Message as logging level.
Public methodStatic member Message(TScope)(ILogger, TScope, Exception, ValueTuple(String, Object)[]) This method writes the exception for provided scope into the logger using Message as logging level.
Public methodStatic member Message(TScope)(ILogger, TScope, String, Exception) This method writes the message and the exception for provided scope into the logger using Message as logging level.
Public methodStatic member Message(TScope)(ILogger, TScope, String, ValueTuple(String, Object)[]) This method writes the message for provided scope into the logger using Message as logging level.
Public methodStatic member Message(TContext)(ILogger(TContext), String, Exception, ValueTuple(String, Object)[]) This method writes the message and the exception for current TContext into the logger using Message as logging level.
Public methodStatic member Message(TScope)(ILogger, TScope, String, Exception, ValueTuple(String, Object)[]) This method writes the message and the exception for provided scope into the logger using Message as logging level.
Public methodStatic member Message(TContext, TScope)(ILogger(TContext), TScope, Exception) This method writes the exception for current TContext taking provided scope into the logger using Message as logging level.
Public methodStatic member Message(TContext, TScope)(ILogger(TContext), TScope, String) This method writes the message for current TContext taking provided scope into the logger using Message as logging level.
Public methodStatic member Message(TContext, TScope)(ILogger(TContext), TScope, Exception, ValueTuple(String, Object)[]) This method writes the exception for current TContext taking provided scope into the logger using Message as logging level.
Public methodStatic member Message(TContext, TScope)(ILogger(TContext), TScope, String, Exception) This method writes the message and the exception for current TContext taking provided scope into the logger using Message as logging level.
Public methodStatic member Message(TContext, TScope)(ILogger(TContext), TScope, String, ValueTuple(String, Object)[]) This method writes the message for current TContext taking provided scope into the logger using Message as logging level.
Public methodStatic member Message(TContext, TScope)(ILogger(TContext), TScope, String, Exception, ValueTuple(String, Object)[]) This method writes the message and the exception for current TContext taking provided scope into the logger using Message as logging level.
  Back to Top

Remarks

Internally, all these methods simply call the logger's write method by providing logging level Message.

Examples

Code snippet below shows a fully qualified example of how to use logger extension method Message(ILogger, String).

using Plexdata.LogWriter.Abstraction;
using Plexdata.LogWriter.Extensions;
using System;

namespace Plexdata.LogWriter.Example
{
    public class SomeClass
    {
        private readonly ILogger logger;

        public SomeClass(ILogger logger)
        {
            this.logger = logger ?? throw new ArgumentNullException(nameof(logger));
        }

        public void SomeMethod()
        {
            this.logger.Message("This is a Message logging entry.");
        }
    }
}

See Also

Reference

Plexdata.LogWriter.Extensions Namespace

Clone this wiki locally