logsnag - LogSnag.NET 1.0.0-beta1

LogSnag .NET client

PM> Install-Package LogSnag.NET -Version 1.0.0-beta1 -Source https://www.myget.org/F/logsnag/api/v3/index.json

Copy to clipboard

> nuget.exe install LogSnag.NET -Version 1.0.0-beta1 -Source https://www.myget.org/F/logsnag/api/v3/index.json

Copy to clipboard

> dotnet add package LogSnag.NET --version 1.0.0-beta1 --source https://www.myget.org/F/logsnag/api/v3/index.json

Copy to clipboard
<PackageReference Include="LogSnag.NET" Version="1.0.0-beta1" />
Copy to clipboard
source https://www.myget.org/F/logsnag/api/v3/index.json

nuget LogSnag.NET  ~> 1.0.0-beta1
Copy to clipboard

> choco install LogSnag.NET --version 1.0.0-beta1 --source https://www.myget.org/F/logsnag/api/v2

Copy to clipboard
Import-Module PowerShellGet
Register-PSRepository -Name "logsnag" -SourceLocation "https://www.myget.org/F/logsnag/api/v2"
Install-Module -Name "LogSnag.NET" -RequiredVersion "1.0.0-beta1" -Repository "logsnag" -AllowPreRelease
Copy to clipboard

Browse the sources in this package using Visual Studio or WinDbg by configuring the following symbol server URL: https://www.myget.org/F/logsnag/api/v2/symbolpackage/


LogSnag.NET

LogSnag client for .NET

CI Publish Pre-Release Publish Release

Package NuGet MyGet (Pre-Releases)
LogSnag.NET NuGet MyGet
LogSnag.NET.Extensions.Microsoft.DependencyInjection NuGet NuGet

Install

You should install with NuGet:

Install-Package LogSnag.NET

Or via the .NET Core command line interface:

dotnet add package LogSnag.NET

How to use

ILogSnagClient client = new LogSnagClient("token");

Or with your own HttpClient

ILogSnagClient client = new LogSnagClient(new HttpClient(), "token");

Publish event

await client.Publish(new LogSnagEvent("project", "channel", "event")
{
    Tags =
    {
        new LogSnagTag("tag-one", 1),
        new LogSnagTag("tag-two", "val2"),
        new LogSnagTag("tag-bool", true)
    },
    Icon = "🫡",
    Description = "This is an event",
    Notify = true,
    Parser = LogSnagParser.Text
});

Publish insight

await client.Insight(new LogSnagInsight("project", "title", "value")
{
    Icon = "👌"
});

Dependency Injection (IHttpClientFactory)

Given you're in an application environment with access to an IServiceCollection container you can use this package instead:

dotnet add package LogSnag.NET.Extensions.Microsoft.DependencyInjection

Which allows one to register ILogSnagClient coupled to a managed HttpClient:

builder.Services.AddLogSnagClient("token");
  • .NETStandard 2.0
    • System.Text.Json (>= 7.0.1)
  • .NETStandard 2.0: 2.0.0.0

Owners

joaopedro.correia

Authors

Joao Correia

Project URL

https://github.com/joaope/logsnag.net

License

Unknown

Tags

logsnag httpclient logging

Info

0 total downloads
0 downloads for version 1.0.0-beta1
Download (12.57 KB)
Download symbols (7.79 KB)
Found on the current feed only

Package history

Version Size Last updated Downloads Mirrored?
1.0.0-beta1 12.57 KB Mon, 02 Jan 2023 03:05:11 GMT 0