DevInstance.LogScope.Extensions.MicrosoftLogger 0.9.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package DevInstance.LogScope.Extensions.MicrosoftLogger --version 0.9.1
NuGet\Install-Package DevInstance.LogScope.Extensions.MicrosoftLogger -Version 0.9.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DevInstance.LogScope.Extensions.MicrosoftLogger" Version="0.9.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DevInstance.LogScope.Extensions.MicrosoftLogger --version 0.9.1
#r "nuget: DevInstance.LogScope.Extensions.MicrosoftLogger, 0.9.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install DevInstance.LogScope.Extensions.MicrosoftLogger as a Cake Addin
#addin nuget:?package=DevInstance.LogScope.Extensions.MicrosoftLogger&version=0.9.1

// Install DevInstance.LogScope.Extensions.MicrosoftLogger as a Cake Tool
#tool nuget:?package=DevInstance.LogScope.Extensions.MicrosoftLogger&version=0.9.1

LogScope

.NET Standard 2.0: Logging, tracing and profiling

LogScope implements simple logging framework for tracing, profiling and logging methods and critical parts of the code. It can be integrated with popular logging library (such as Log4Net, NLog, etc). The whole idea is around using a “scope”. Scope can be method or a specific part of it. The implementation is based on IDisposable where calling Dispose ends the scope. The following example demonstrate this approach:

   {
       using (var methodScope = classScope.DebugScope())
       {
           methodScope.D("Inside of method Foo scope");
           Thread.Sleep(200);
       }
   }

Result:

--> begin of Foo
   Foo: Inside of method Foo scope
<-- end of Foo, time:3 msec

It can be useful for the apps to trace the performance or async code calls.

    class TestClass
    {
        IScopeLog classScope;

        public TestClass(IScopeManager manager)
        {
            classScope = manager.CreateLogger(this);
        }

        public void MethodA()
        {
            using (var methodScope = classScope.DebugScope())
            {
                methodScope.D("Wait for 200 msec");
                Thread.Sleep(200);
                methodScope.D("Done.");
                using (var aScope = methodScope.DebugScope("a-scope"))
                {
                    aScope.D("Inside of a scope");
                }
                MethodB();
            }
        }

        private void MethodB()
        {
            using (var methodScope = classScope.DebugScope())
            {
                methodScope.D("Inside of method B scope");
                Thread.Sleep(200);
            }
        }
    }

Result:

21-01-29 23:07:24--> begin of TestClass:MethodA
21-01-29 23:07:24       TestClass:MethodA:Wait for 200 msec
21-01-29 23:07:25       TestClass:MethodA:Done.
21-01-29 23:07:25--> begin of TestClass:MethodA:a-scope
21-01-29 23:07:25       TestClass:MethodA:a-scope:Inside of a scope
21-01-29 23:07:25<-- end of TestClass:MethodA:a-scope, time:2.1252 msec
21-01-29 23:07:25--> begin of TestClass:MethodB
21-01-29 23:07:25       TestClass:MethodB:Inside of method B scope
21-01-29 23:07:25<-- end of TestClass:MethodB, time:212.748 msec
21-01-29 23:07:25<-- end of TestClass:MethodA, time:480.5525 msec

See more https://devinstance.net/blog/dotnet-standard-logging-and-profiling

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.1 428 8/24/2022
1.0.0 346 8/22/2022
0.9.4 411 2/14/2022
0.9.2 249 11/30/2021
0.9.1 392 5/30/2021
0.9.0 261 5/4/2021

Support of LogScope 1.2.0