GithubHelp home page GithubHelp logo

jjm-one / jjm.one.microsoft.extensions.logging.helpers Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 1.0 407 KB

A collection of helper functions for the Microsoft logging tool.

Home Page: https://jjm-one.github.io/jjm.one.Microsoft.Extensions.Logging.Helpers/

License: Other

C# 100.00%
csharp extension logging microsoft-extensions microsoft-extensions-logging

jjm.one.microsoft.extensions.logging.helpers's Introduction

jjm.one.Microsoft.Extensions.Logging.Helpers

A collection of helper functions for the Microsoft.Extensions.Logging logging tool.

Status

Build & Test Status (main) Build&Test
Nuget Package Version Nuget Version
SonarCloudQuality Gate Status Quality Gate Status

Table of contents

Nuget Package

You can get the latest version of this software as a nuget package form nuget.org

Installing the Nuget Package

Tool Command/Code
Package Manager PM> Install-Package jjm.one.Microsoft.Extensions.Logging.Helpers -Version X.Y.Z
.NET CLI > dotnet add package jjm.one.Microsoft.Extensions.Logging.Helpers --version X.Y.Z
PackageReference <PackageReference Include="jjm.one.Microsoft.Extensions.Logging.Helpers" Version="X.Y.Z" />
Package CLI > paket add jjm.one.Microsoft.Extensions.Logging.Helpers --version X.Y.Z
Script & Interactive > #r "nuget: jjm.one.Microsoft.Extensions.Logging.Helpers, X.Y.Z"
Cake as Addin #addin nuget:?package=jjm.one.Microsoft.Extensions.Logging.Helpers&version=X.Y.Z
Cake as Tool #tool nuget:?package=jjm.one.Microsoft.Extensions.Logging.Helpers&version=X.Y.Z

Usage

Use function logging

class MyClass {

    // ...

    void MyFancyFunction() {

        // log the function call (minimal parameters)
        logger.LogFctCall();

        // log the function call (full parameters)
        logger.LogFctCall(GetType(), MethodBase.GetCurrentMethod(), LogLevel.Debug);

        try {
            
            //...
        }
        catch (Exception exc) {

            // Log the exception (minimal parameters)      
            logger.LogExcInFctCall(exc);      

            // Log the exception (full parameters)
            logger.LogExcInFctCall(exc, GetType(), MethodBase.GetCurrentMethod(), "My custom exception message!", LogLevel.Error);
        }
    }

    // ...
}

Output of function logging

Function called: MyClass -> MyFancyFunction
Exception thrown in: MyClass -> MyFancyFunction
My custom exception message!

Full Documentation

The full documentation for this package can be found here.

Repo

The associated repo for this package can be found here.

jjm.one.microsoft.extensions.logging.helpers's People

Contributors

dependabot[bot] avatar falch-traineeit avatar jonas-merkle avatar

Watchers

 avatar

Forkers

falch-gmbh

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.