Skip to content
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

other: Code refactoring for LoggingService.cs #1217

Merged
merged 5 commits into from
Apr 8, 2023

Conversation

aayushpandya
Copy link
Contributor

Code refactoring for LoggingService.cs

PR Type

What kind of change does this PR introduce?

other: Code refactoring for LoggingService.cs

Other information

I've refactored the code to make it more readable, maintainable.

Changes:

  1. Renamed the MessageFormat constant to MessageFormatString to make its purpose clearer.
  2. Introduced an explaining variable timeStamp for the DateTime.UtcNow.ToString(CultureInfo.InvariantCulture) to make the code more readable.
  3. The WriteLogMessages() method was extracted from the InitializeLogFileWriterBackgroundTaskAsync() method to separate the responsibility of continuously writing the log messages from the initialization process. By doing so, the code is more readable, maintainable, and adheres to the Single Responsibility Principle.

@aayushpandya aayushpandya changed the title Code Refactoring for LoggingService.cs other: Code refactoring for LoggingService.cs Apr 2, 2023
@0x7c13 0x7c13 merged commit 722cced into 0x7c13:master Apr 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants