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

Temporarily fix VB App Framework Logging. #7590

Merged
merged 14 commits into from
Aug 15, 2022
Merged
Show file tree
Hide file tree
Changes from 12 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
@@ -1,4 +1,4 @@
<Project>
KlausLoeffelmann marked this conversation as resolved.
Show resolved Hide resolved
<Project>
<!--
https://github.com/dotnet/winforms/issues/2107#issuecomment-559289716
https://github.com/microsoft/msbuild/issues/4923#issuecomment-554265394
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Imports System.Collections.Specialized
Imports System.ComponentModel
Imports System.Text
Imports Microsoft.VisualBasic.CompilerServices.ExceptionUtils
Imports System.Windows.Forms.Primitives

Namespace Microsoft.VisualBasic.Logging

Expand Down Expand Up @@ -163,20 +164,12 @@ Namespace Microsoft.VisualBasic.Logging
If _listenerAttributes Is Nothing Then
_listenerAttributes = Attributes
End If
Return _hasBeenInitializedFromConfigFile
Copy link
Member

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
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
Member

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
Member

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