ReportSharp.DiscordReporter 1.0.5.1

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

// Install ReportSharp.DiscordReporter as a Cake Tool
#tool nuget:?package=ReportSharp.DiscordReporter&version=1.0.5.1                

ReportSharp.DiscordReporter-1.0.5:

Description:

DiscordReporter for ReportSharp package

Dependencies:

ReportSharp 1.0.5 or later

Dotnet Core 3.1 or later

Usage:

Note:

You need to install and configure ReportSharp 1.0.5 or later to use this package.

Dotnet 5 or below:

  1. Add following lines to ConfigureServices method in Startup class:
services.AddReportSharp(options => {
    options.ConfigReportSharp(configBuilder =>
        configBuilder.SetWatchdogPrefix("/")
    );
    // For request reporter
    options.AddRequestReporter(() => new DiscordReporterOptionsBuilder()
        .SetToken("DiscordToken")
        .AddChannelId(discordChannelId)
    );
    // For exception reporter
    options.AddExceptionReporter(() => new DiscordReporterOptionsBuilder()
        .SetToken("DiscordToken")
        .AddChannelId(discordChannelId)
    );
    // For data reporter
    options.AddDataReporter(() => new DiscordReporterOptionsBuilder()
        .SetToken("DiscordToken")
        .AddChannelId(discordChannelId)
    );
    // For request, exception and data reporter
    options.AddReporter<DiscordReporter,DiscordReporterOptionsBuilder>(
        () => new DiscordReporterOptionsBuilder()
            .SetToken("DiscordToken")
            .AddChannelId(discordChannelId)
    );
});
Note: if you want to it for all reporters, you can use only AddReporter method.
  1. Add following lines to Configure method in Startup class:
app.UseReportSharp(configure => {
    configure.UseReportSharpMiddleware<ReportSharpMiddleware>();
});

Dotnet 6 or later:

  1. Add following lines to services section, before builder.Build() line:
services.AddReportSharp(options => {
    options.ConfigReportSharp(configBuilder =>
        configBuilder.SetWatchdogPrefix("/")
    );
    // For request reporter
    options.AddRequestReporter(() => new DiscordReporterOptionsBuilder()
        .SetToken("DiscordToken")
        .AddChannelId(discordChannelId)
    );
    // For exception reporter
    options.AddExceptionReporter(() => new DiscordReporterOptionsBuilder()
        .SetToken("DiscordToken")
        .AddChannelId(discordChannelId)
    );
    // For data reporter
    options.AddDataReporter(() => new DiscordReporterOptionsBuilder()
        .SetToken("DiscordToken")
        .AddChannelId(discordChannelId)
    );
    // For request, exception and data reporter
    options.AddReporter<DiscordReporter,DiscordReporterOptionsBuilder>(
        () => new DiscordReporterOptionsBuilder()
            .SetToken("DiscordToken")
            .AddChannelId(discordChannelId)
    );
});
Note: if you want to it for all reporters, you can use only AddReporter method.
  1. Add following lines to Configure section, somewhere after builder.Build() line and before app.Run() line:
app.UseReportSharp(configure => {
    configure.UseReportSharpMiddleware<ReportSharpMiddleware>();
});

Donation:

If you like it, you can support me with USDT:
  1. TJ57yPBVwwK8rjWDxogkGJH1nF3TGPVq98 for USDT TRC20
  2. 0x743379201B80dA1CB680aC08F54b058Ac01346F1 for USDT ERC20
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  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. 
.NET Core netcoreapp3.1 is compatible. 
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.