-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve logging #41
Comments
I would like to propose the implementation of an The first three digits will be related to a specific project:
The last three digits will determine the log level and the log's ID:
For example, the complete This system will provide a clear and structured way to identify events in our logs, making it easier to track and troubleshoot issues. Please feel free to share your thoughts and feedback on this proposal. I will prepare a PR for the Ping protocol to make it more clear. |
@chertby it's good to have some structure but it seems like complication for potential contributors, another rule to keep in mind. Let's start by having just incremental numbers for the messages which is already a lot. |
@flcl42 I’ll prepare a simpler version today. |
I still suggest leaving different event IDs for different protocols. But then use a simple increment. Use the name of the function itself as an event hire. It’s simpler than the previous option, but we keep good logging, which should help with debugging. I updated PR private const int EventId = 200_000;
[LoggerMessage(
EventId = EventId + 1,
EventName = nameof(ReadingPong),
Message = "Reading pong",
Level = LogLevel.Trace)]
internal static partial void ReadingPong(
this ILogger logger);
[LoggerMessage(
EventId = EventId + 2,
EventName = nameof(VerifyingPong),
Message = "Verifying pong",
Level = LogLevel.Trace)]
internal static partial void VerifyingPong(
this ILogger logger); |
…ve_logging_in_ping
The text was updated successfully, but these errors were encountered: