SimpleWasmConsole 1.0.1

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

// Install SimpleWasmConsole as a Cake Tool
#tool nuget:?package=SimpleWasmConsole&version=1.0.1

SimpleWasmConsole

A simple wrapper around the browser based console api.

How to Install

  • Add via nuget
  • Add @using SimpleWasmConsole to the _Imports.razor file in your Client project
  • Call builder.Services.AddSimpleWasmConsole(); within the startup (Program.cs) in your Client project
    • Contains override to allow for disabling for particular environments: builder.Services.AddSimpleWasmConsole(builder.HostEnvironment.Environment == "Prodution")

How to Use

  • Inject the service at the top of your component or page: @inject ISimpleWasmConsole _console
  • Invoke the needed console command: await _console.LogAsync("Logging", object)
@inject ISimpleWasmConsole _console

@code{
    protected override async Task OnAfterRenderAsync(bool firstRender)
    {
        _console.DebugAsync("OnAfterRenderAsync Called", firstRender);
    }
}

Current methods

  • ClearAsync();, Calls "console.clear" on the client to clear the console log output
  • CountAsync();, Calls "console.count" on the client
  • DebugAsync(params object?[]? args);, Calls "console.debug" on the client passing the args along with it.
  • DirAsync(object obj);, Calls "console.dir" on the client passing the args along with it.
  • ErrorAsync(params object?[]? args);, Calls "console.error" on the client passing the args along with it.
  • InfoAsync(params object?[]? args);, Calls "console.info" on the client passing the args along with it.
  • LogAsync(params object?[]? args);, Calls "console.table" on the client passing the args along with it. Make sure to use lowerCamelCasing when supplying the fields.
  • TableAsync(object? o, string[]? fields = null);, Calls "console.time" on the client, starting a timer. Call TimerEnd to stop timer and TimeLog to output.
  • TimeAsync();, Calls "console.time" on the client, starting a timer.
  • TimeEndAsync();, Calls "console.timeEnd" on the client.
  • TimeLogAsync();, Calls "console.timeLog" on the client, printing out the time since the timer start.
  • TraceAsync();, Calls "console.trace" on the client
  • WarnAsync(params object?[]? args);, Calls "console.warn" on the client passing the args along with it.
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  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 625 8/31/2023
1.0.0 107 8/30/2023