Skip to content

Logging #9

@hendryluk

Description

@hendryluk

From Jboss Weld.
A simple support for logging:

public class MyClass
{
   [Inject, Logger] ILogger _logger;
}

Which is equivalent to the traditional way:

public class MyClass
{
    private static ILogger _logger = LogFactory.GetLogger(typeof(MyClass));
}

This should be part of the Cormo core (instead of a separate module). However I'm thinking of using CommonLogger (instead of a specific logging framework, due to fragmentation of .net loggers), with the downside being it requires developers to add an extra nuget (for their logging-framework of choice) to get logging happen, instead of just happen by default without the need to add any other dependency. But at least by default it should write logs to .net's Debug and Trace.
This also includes writing log entries from within all over Cormo codebase.

Jboss Weld also comes with more advanced ways of logging, such as typed logging, message-bundles, and internationalization. I'm not sure how much value it will add to us, so I'm deferring that implementation and just stick with a simpler logger injection for now
Ref: https://docs.jboss.org/weld/extensions/reference/latest/en-US/html_single/#logging

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions