LogSnag 1.0.0

dotnet add package LogSnag --version 1.0.0                
NuGet\Install-Package LogSnag -Version 1.0.0                
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="LogSnag" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add LogSnag --version 1.0.0                
#r "nuget: LogSnag, 1.0.0"                
#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 LogSnag as a Cake Addin
#addin nuget:?package=LogSnag&version=1.0.0

// Install LogSnag as a Cake Tool
#tool nuget:?package=LogSnag&version=1.0.0                

LogSnagSharp

A NuGet class library for LogSnag

About The Project

LogSnagSharp provides a NuGet class library "LogSnag" targeting .NET 5.0 for simple LogSnag integration into any C# project. This library handles the JSON encoding and transmitting of the POST requests required to send notifications to LogSnag in order to offload these responsibilities from the app developer.

Installation

This package can be installed directly through Visual Studio's NuGet Package Manager or through the command line using the commands given on the nuget.org package page.

Usage

This package exposes a single class LogSnag which can be used to publish to a project. The project can either be set explicitly and reused with the LogSnag(String, String) constructor or with the SetProject(String) method used on an already constructed instance of LogSnag, or it can be explicitly provided to each publication using the PublishToProject method.

The Publish and PublishToProject methods provide optional parameters for full compatablity with the entire LogSnag API. Check the documentation at the LogSnag Project for full descriptions these optional parameters.

Example of using a single, explicitly set project for multiple publishes:

LogSnag client = new LogSnag("myAuthId", "my-project");
client.Publish("status-channel", "Service started");
// Perform service functions
if(failure)
{
    client.Publish("error-channel", $"Fatal error: {errorString}");
    client.Publish("status-channel", "Service stopped");
}

Example of using PublishToProject to publish to several projects:

LogSnag client = new LogSnag("myAuthId");
// Process requests for multiple services
client.PublishToProject(service.ProjectName, channelName);

Example of using SetProject to publish to different projects at different times:

LogSnag client = new LogSnag("myAuthId");
while(servicesRequested)
{
    if(requestedService == Services.SERVICE_ONE)
    {
        client.SetProject("service-one");
    }
    else
    {
        client.SetProject("service-two");
    }

    client.Publish("info", "User Logged In!");

    // Do processing
}

License

Distributed under the MIT License. See LICENSE for more information.

Acknowledgements

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.
  • net5.0

    • No dependencies.

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.0 561 3/16/2022