By @geeknoid
- Event id is not an effective concept; customers don't want to use it and don't have anything to do with it. So, we want overloads that don't require that.
- We are trying to shift customers to not use message strings and stick with structured logging. So, we want overloads that don't include a message.
- We routinely find situations where log levels are specified as a logging method parameter rather than in the attribute definition, so we want overloads that don't include a level.
Bottom line is that the lack of these constructors leads to considerably more ceremony for the customers. More stuff to type with no upside to them.
Proposal
public sealed class LoggerMessageAttribute : Attribute
{
public LoggerMessageAttribute()
public LoggerMessageAttribute(int eventId, LogLevel level, string message)
+ public LoggerMessageAttribute(LogLevel level, string message)
+ public LoggerMessageAttribute(LogLevel level)
+ public LoggerMessageAttribute(string message)
}
Original description
dotnet/extensions supports a variety of shortcut constructors on LogMethodAttribute. In the past these shortcuts were deemed undesirable. While I don't know the details behind the original decisions, now that we have more history of internal usage and a better track record we should reconsider.
@geeknoid - can you enumerate exactly which APIs you hope to bring over?
By @geeknoid
Bottom line is that the lack of these constructors leads to considerably more ceremony for the customers. More stuff to type with no upside to them.
Proposal
public sealed class LoggerMessageAttribute : Attribute { public LoggerMessageAttribute() public LoggerMessageAttribute(int eventId, LogLevel level, string message) + public LoggerMessageAttribute(LogLevel level, string message) + public LoggerMessageAttribute(LogLevel level) + public LoggerMessageAttribute(string message) }Original description
dotnet/extensions supports a variety of shortcut constructors on LogMethodAttribute. In the past these shortcuts were deemed undesirable. While I don't know the details behind the original decisions, now that we have more history of internal usage and a better track record we should reconsider.
@geeknoid - can you enumerate exactly which APIs you hope to bring over?