NetCordDev / NetCordDev/NetCord

Grouped Logging needs refactoring

Open
#346 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
C#
Stars
454
Forks
42
Avg merge
22h 41m
Merged PRs (30d)
14

Description

Description

There are numerous traces of:

$"...{Environment.NewLine}{e}"

When calling log and setting the message for errors (exceptions).

This pattern isn't deployable; let's have the logger handle exception formatting instead.

Especially if some exceptions should be treated as WARN instead of ERR.


Also, another thing is reducing redundant logger because of log tagging.

Log tagging was done by separating logger interfaces, but they ended up redundant, with the same structure.
(e.g., IVoiceLogger, IRestLogger, IGatewayLogger)

The only difference is actually in the default logger implementation.
(e.g., ShardedTextWriterLogger, TextWriterLogger)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the interpolated exception messages using Environment.NewLine and the logger interfaces named in the issue, including IVoiceLogger, IRestLogger, IGatewayLogger, ShardedTextWriterLogger, and TextWriterLogger. The refactor is done when exception formatting is handled by the logger, WARN versus ERR treatment remains possible, and redundant logger interfaces are removed without losing tagging behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
observability
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.