WASM.Console
0.0.12
dotnet add package WASM.Console --version 0.0.12
NuGet\Install-Package WASM.Console -Version 0.0.12
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="WASM.Console" Version="0.0.12" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add WASM.Console --version 0.0.12
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: WASM.Console, 0.0.12"
#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 WASM.Console as a Cake Addin #addin nuget:?package=WASM.Console&version=0.0.12 // Install WASM.Console as a Cake Tool #tool nuget:?package=WASM.Console&version=0.0.12
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
WASM.Console
A Blazor library for writing to the browser console in C# using .
Supports: console.log
, console.debug
, console.info
, console.warn
, console.error
, console.dir
, and more.
Add the following nuget package:
dotnet CLI:
dotnet add package WASM.Console
Example:
using WASM.Console;
var console = new BrowserConsole();
// The different log message types
await console.LogAsync("A simple log message.");
// you may need to turn on Verbose to see debug level messages
await console.DebugAsync("Logs an Debug level message.");
await console.InfoAsync("Logs an Info level message.");
await console.WarnAsync("Logs an Warning level message.");
await console.ErrorAsync("Logs an Error level message.");
// group messages together:
using(await console.GroupAsync())
{
await console.LogAsync("Grouped log message 1.");
await console.LogAsync("Grouped log message 2.");
await console.LogAsync("Grouped log message 3.");
// when the group is disposed console.GroupEnd() will automatically be called.
}
// print an object's properties
var obj = new {
Prop1 = "Test Property 1",
Prop2 = "Test Property 2"
};
await console.DirAsync(obj);
// print a table
var objArray = new[]
{
new { Id = Guid.NewGuid(), Prop1 = "test prop 1" },
new { Id = Guid.NewGuid(), Prop1 = "test prop 2" },
new { Id = Guid.NewGuid(), Prop1 = "test prop 3" },
new { Id = Guid.NewGuid(), Prop1 = "test prop 4" },
new { Id = Guid.NewGuid(), Prop1 = "test prop 5" }
}
await console.TableAsync(objArray);
// start and end a timer
await console.TimeAsync("timer 1");
await console.TimeEndAsync("timer 1");
Product | Versions 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.
-
net6.0
- Microsoft.JSInterop.WebAssembly (>= 6.0.9)
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 |
---|---|---|
0.0.12 | 786 | 9/20/2022 |
0.0.11 | 690 | 9/20/2022 |
0.0.10 | 718 | 9/20/2022 |
0.0.2-alpha | 649 | 9/20/2022 |