improve logging in profile filter

This commit is contained in:
Jonathan Jenne
2019-10-24 16:34:32 +02:00
parent 8239883b47
commit 660231325c
2 changed files with 40 additions and 17 deletions

View File

@@ -25,6 +25,8 @@ Public Class ProfileMatch
End Function
Public Function NewProfileNode(Profile As ProfileData) As TreeNode
_Logger.Debug("New Profile Node for Profile {0}", Profile.Name)
Dim oNode As New TreeNode() With {
.Text = $"Profile: {Profile.Name}",
.ImageIndex = ProfileFilter.ImageIndex.Profile,
@@ -35,8 +37,9 @@ Public Class ProfileMatch
End Function
Public Function NewClipboardRegexNode(Profile As ProfileData, IsMatch As Boolean) As TreeNode
Dim oText = $"{GetMatchText(IsMatch)} on Global Clipboard Regex {Profile.Regex}"
_Logger.Debug("New Clipboard Regex Node for Profile {0}", Profile.Name)
Dim oText = $"{GetMatchText(IsMatch)} on Global Clipboard Regex {Profile.Regex}"
Dim oNode As New TreeNode() With {
.Text = oText,
.ImageIndex = ProfileFilter.ImageIndex.Clipboard,
@@ -47,9 +50,10 @@ Public Class ProfileMatch
Return oNode
End Function
Public Function NewProcessNode(Profile As ProfileData, Process As ProcessData, IsMatch As Boolean) As TreeNode
_Logger.Debug("New Process Node for Profile {0} and ProcessName {1}", Profile.Name, Process.ProcessName)
Dim oMatchText = IIf(IsMatch, "MATCH", "NO MATCH")
Dim oText = $"{GetMatchText(IsMatch)} on ProcessName {Process.ProcessName}"
Dim oNode As New TreeNode() With {
.Text = oText,
.ImageIndex = ProfileFilter.ImageIndex.Process,
@@ -61,9 +65,10 @@ Public Class ProfileMatch
End Function
Public Function NewWindowNode(Profile As ProfileData, Window As WindowData, IsMatch As Boolean) As TreeNode
_Logger.Debug("New Window Node for Profile {0} and WindowTitle {1}", Profile.Name, Window.Title)
Dim oMatchText = IIf(IsMatch, "MATCH", "NO MATCH")
Dim oText = $"{GetMatchText(IsMatch)} on WindowTitle {Window.Title}"
Dim oNode As New TreeNode() With {
.Text = oText,
.ImageIndex = ProfileFilter.ImageIndex.Window,
@@ -75,6 +80,8 @@ Public Class ProfileMatch
End Function
Public Function NewControlNode(Profile As ProfileData, Control As ControlData, IsMatch As Boolean) As TreeNode
_Logger.Debug("New Control Node for Profile {0} and Control {1}", Profile.Name, Control.Description)
Dim oMatchText = IIf(IsMatch, "MATCH", "NO MATCH")
Dim oText = $"{GetMatchText(IsMatch)} on Control {Control.Description}: {IsMatch.ToString}"