Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -163,20 +163,12 @@ Namespace Microsoft.VisualBasic.Logging
If _listenerAttributes Is Nothing Then
_listenerAttributes = Attributes
End If
Return _hasBeenInitializedFromConfigFile
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would had returned false here for the RC and would have worked on the proper fix, i.e. how to get if this was initialized from the config file.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about this first. But then I thought, there is a good chance it will stay like this, and then we could have it right away.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is a good chance it will stay like this,

Maybe runtime can add a protected property for us to look up?


' TODO: This is a tempory fix, which will break configuring logging via file for the time being. See: https://github.com/dotnet/winforms/pull/7590
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you open a follow up bug to get this fixed?

Return False
End Get
End Property

''' <summary>
''' Overriding this function is the trick that tells us whether this trace source was configured
''' from a config file or not. It only gets called if a config file was found.
''' </summary>
Protected Overrides Function GetSupportedAttributes() As String()
_hasBeenInitializedFromConfigFile = True
Return MyBase.GetSupportedAttributes()
End Function

Private _hasBeenInitializedFromConfigFile As Boolean 'True if we this TraceSource is initialized from a config file. False if somebody just news one up.
Private _listenerAttributes As StringDictionary

End Class
Expand Down