All Projects → BlazorExtensions → Logging

BlazorExtensions / Logging

Licence: mit
Microsoft Extension Logging implementation for Blazor

Projects that are alternatives of or similar to Logging

Wasm Pdf
Generate PDF files with JavaScript and WASM (WebAssembly)
Stars: ✭ 163 (-1.21%)
Mutual labels:  webassembly, wasm
Assemblyscript
A TypeScript-like language for WebAssembly.
Stars: ✭ 13,152 (+7870.91%)
Mutual labels:  webassembly, wasm
Woz
Woz is a progressive WebAssembly app (PWAA) generator for Rust.
Stars: ✭ 145 (-12.12%)
Mutual labels:  webassembly, wasm
Wain
WebAssembly implementation from scratch in Safe Rust with zero dependencies
Stars: ✭ 160 (-3.03%)
Mutual labels:  webassembly, wasm
Spec
WebAssembly for Proxies (ABI specification)
Stars: ✭ 150 (-9.09%)
Mutual labels:  webassembly, wasm
Proxy Wasm Go Sdk
Go SDK for WebAssembly-based Envoy extensions
Stars: ✭ 137 (-16.97%)
Mutual labels:  webassembly, wasm
Blazor Samples
Explore and learn Syncfusion Blazor components using large collection of demos, example applications and tutorial samples
Stars: ✭ 156 (-5.45%)
Mutual labels:  webassembly, wasm
Opencombine
Open source implementation of Apple's Combine framework for processing values over time.
Stars: ✭ 2,040 (+1136.36%)
Mutual labels:  webassembly, wasm
Libarchivejs
Archive library for browsers
Stars: ✭ 145 (-12.12%)
Mutual labels:  webassembly, wasm
Wasm Crypto
A WebAssembly (via AssemblyScript) set of cryptographic primitives for building authentication and key exchange protocols.
Stars: ✭ 146 (-11.52%)
Mutual labels:  webassembly, wasm
Nes Rust
NES emulator written in Rust + WASM
Stars: ✭ 141 (-14.55%)
Mutual labels:  webassembly, wasm
Wasmer Java
☕ WebAssembly runtime for Java
Stars: ✭ 152 (-7.88%)
Mutual labels:  webassembly, wasm
Proxy Wasm Rust Sdk
WebAssembly for Proxies (Rust SDK)
Stars: ✭ 137 (-16.97%)
Mutual labels:  webassembly, wasm
Modern Wasm Starter
🛸 Run C++ code on web and create blazingly fast websites! A starter template to easily create WebAssembly packages using type-safe C++ bindings with automatic TypeScript declarations.
Stars: ✭ 140 (-15.15%)
Mutual labels:  webassembly, wasm
Awesome Wasm Tools
😎 A curated list of awesome, language-agnostic WebAssembly tools
Stars: ✭ 139 (-15.76%)
Mutual labels:  webassembly, wasm
Json Logging Python
Python logging library to emit JSON log that can be easily indexed and searchable by logging infrastructure such as ELK, EFK, AWS Cloudwatch, GCP Stackdriver
Stars: ✭ 143 (-13.33%)
Mutual labels:  logging, logging-library
Blazormaterial
Blazor components implementing Google's Material components for web - https://material.io/components/web
Stars: ✭ 136 (-17.58%)
Mutual labels:  webassembly, wasm
As Wasi
An AssemblyScript API layer for WASI system calls.
Stars: ✭ 135 (-18.18%)
Mutual labels:  webassembly, wasm
Rs Asteroids
A variation on the game Asteroids, written in Rust
Stars: ✭ 146 (-11.52%)
Mutual labels:  webassembly, wasm
Deno Sqlite
Deno SQLite module
Stars: ✭ 151 (-8.48%)
Mutual labels:  webassembly, wasm

Build Package Version NuGet Downloads License

Blazor Extensions

Blazor Extensions is a set of packages with the goal of adding useful features to Blazor.

Blazor Extensions Logging

This package is an implementation for the Microsoft Extensions Logging abstraction to support using the ILogger interface in your Blazor code.

When the component is configured, all the log statements will appear in the browser's developer tools console.

Features

Content to log

The logger supports the same string formatting that MEL provides, together with named parameter replacement in the message.

Additionaly, you're able to log an object in the browser console. You can expand members and hierachies to see what's contained within.

If you want to log an enumerable list of objects, then the browser side component will display it by calling console.table.

Filtering

The implementation supports the ILoggerFactory-based filtering configuration that is supplied by the Microsoft Extension Logging abstraction.

To keep it lightweight, Microsoft Extensions Configuration based configuration is not supported; the logger can be only configured in code.

Log levels

The logger supports the LogLevels defined in MEL.

Some of the log levels are not available as distinct methods in the browser's developer tool, so the browser side component does some mapping.

Sample configuration

Setup

The following snippet shows how to setup the browser console logger by registering it for dependency injection in the Program.cs of the application.

// Add Blazor.Extensions.Logging.BrowserConsoleLogger
builder.Services.AddLogging(builder => builder
    .AddBrowserConsole()
    .SetMinimumLevel(LogLevel.Trace)
);

Usage

The following snippet shows how to consume the logger in a Blazor component.

@inject ILogger<Index> logger

@functions {
  protected override async Task OnInitializedAsync()
  {
      logger.LogDebug("MyComponent init");
  }
}

If you want to consume it outside of a cshtml based component, then you can use the Inject attribute to inject it into the class.

[Inject]
protected ILogger<MyClass> Logger {get;set;}

public void LogSomething()
{
  Logger.LogDebug("Inside LogSomething");
}

Contributions and feedback

Please feel free to use the component, open issues, fix bugs or provide feedback.

Contributors

The following people are the maintainers of the Blazor Extensions projects:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].