Giter Site home page Giter Site logo

fedarovich / isle Goto Github PK

View Code? Open in Web Editor NEW
45.0 45.0 1.0 353 KB

ISLE (Interpolated String Logging Extensions) is a library that allows developers to perform structured logging using interpolated strings in C# 10 or later.

License: MIT License

C# 98.48% PowerShell 1.52%

isle's People

Contributors

fedarovich avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

johnjuuljensen

isle's Issues

Consider moving logging handlers to non ref structs

Thanks for this library, I'm quite liking using it. However, I'd like to request that the interpolation handlers be changed to regular structs, not ref structs. As far as I can tell, there's no nested ref struct usage in the handlers, so there's no benefit for them being marked as ref structs. This blocks their usage with interpolation arguments that are await expressions (which, yes, it can certainly be argued that logging shouldn't have nested asyncs, but given that interpolation won't execute it if the log level isn't enabled I think this case is fine).

"Isle has already been configured" error in integration tests

ISLE breaks ASP.NET Core integration tests that are created with WebApplicationFactory<TEntryPoint> as documented here.
With such tests the startup code, and therefore also IsleConfiguration.Configure(), is executed once for each test. But ISLE throws an exception on every call after the first one.

Allow parallel integration tests

This issue is very similar to #3
As explained there, you have to call IsleConfiguration.Reset() to get ASP.NET Core integration tests with ISLE to work.
But this only helps as long as you execute all integration tests sequentially. If you want to execute them in parallel then you'll again get "Isle has already been configured" exceptions because multiple IsleConfiguration.Configure calls may happen between the IsleConfiguration.Reset() calls.

Please make it possible to run parallel ASP.NET Core integration tests with ISLE.

Updating to Serilog 3.x

Any chance ISLE could be update to work with Serilog 3.x? Especially since Serilog 2.x will not get updates anymore since .NET 8.

For example, right now I get the following error when calling WarningInterpolated:
_logger.WarningInterpolated($"User {query.Username} does not exist.");

System.MissingMethodException: 'Method not found: 'Void Serilog.Parsing.TextToken..ctor(System.String, Int32)'.'

This probably comes from a change in Serilog's API.

Logging calls with expressions don't work

Example code:

var now = DateTime.Now;
_logger.LogInformation($"property: {now.Day}");
var day = now.Day;
_logger.LogInformation($"simple: {day}");

Expected output:

property: 24
simple: 24

Actual output:

property: {now.Day}
simple: 24

The property access expressions could also be for more levels, that should also be supported.
The last step could also be a method call instead of a property access.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.