Skip to content

Conversation

@cobya
Copy link
Contributor

@cobya cobya commented Feb 21, 2023

Within the logger class there is nothing to prevent re-initialization of the log file if there is an external caller to the Init method. This may cause exceptions such as The process cannot access the file 'C:\Temp\BuildAgent\_work\1\a\GovCompDisc_Log_20230221094929531.log' because it is being used by another process. where the file can't be overwritten due to already being in use.

Add an early exit to Logger.Init if already initialized to prevent this.

@cobya cobya added the type:bug Bug fix of existing functionality label Feb 21, 2023
@cobya cobya requested a review from a team as a code owner February 21, 2023 17:50
@cobya cobya requested a review from grvillic February 21, 2023 17:50
@cobya cobya enabled auto-merge (squash) February 21, 2023 18:17
@cobya cobya merged commit 2652bf8 into main Feb 21, 2023
@cobya cobya deleted the cobya/LoggerInit branch February 21, 2023 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:bug Bug fix of existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants