Improve logging

This commit is contained in:
Jonathan Jenne 2022-10-10 11:45:25 +02:00
parent 16ace2c242
commit 2da202a2a7

View File

@ -18,7 +18,7 @@ Namespace Templates
Public Property FilterConfiguration As New FilterConfig
Private Const SQL_TBMT_FILTERS = "SELECT * FROM [DD_ECM].[dbo].[VWMT_FILTERS]"
Private Const SQL_VWMT_ITEMS = "SELECT * FROM [DD_ECM].[dbo].[VWMT_ITEMS]"
Private Const SQL_VWMT_ITEMS = "SELECT * FROM [DD_ECM].[dbo].[VWMT_ITEMS] ORDER BY TEMPLATE_NAME, TABLE_NAME"
Private Const SQL_VWMT_MAPPING = "SELECT * FROM [DD_ECM].[dbo].[VWMT_MAPPING]"
Private Const SQL_TBMT_MANDATORS = "SELECT * FROM [DD_ECM].[dbo].[TBMT_MANDATORS] ORDER BY ORDER_KEY"
Private Const SQL_TBMT_CONFIG = "SELECT * FROM [DD_ECM].[dbo].[TBMT_CONFIG]"
@ -73,6 +73,8 @@ Namespace Templates
.Parameter2 = oRow.ItemEx("PARAMETER_2", String.Empty)
}
Logger.Debug("Loading Template [{0}]", oTemplate.Name)
oTemplates.Add(oTemplate)
Next
@ -207,6 +209,8 @@ Namespace Templates
}
}
Logger.Debug("Creating Template Item for Table [{0}]: [{1}]", oColumn.Table, oColumn.Name)
oItems.Add(oColumn)
Next
@ -267,6 +271,7 @@ Namespace Templates
Public Function UpdateTemplateTablesFromDatabase(pTemplate As Template, pTemplateConfig As TemplateConfig) As Template
If pTemplateConfig Is Nothing Then
Logger.Warn("Template config is empty. Skipping.")
Return pTemplate
End If
@ -300,7 +305,7 @@ Namespace Templates
Dim oTable = pTemplate.Tables.Where(Function(table) table.Name = oItem.Table).FirstOrDefault()
If oTable Is Nothing Then
Logger.Warn("Table [{0}] for item [{1}] does exist in this Template!", oItem.Table, oItem.Name)
Logger.Warn("Table [{0}] for item [{1}] does not exist in this Template!", oItem.Table, oItem.Name)
Continue For
End If