tracing - Good practice?
Posted on 2012-08-30
I have never used tracing.
I have always used a simple technique going back to vb6 and vba like this
Dim LN as double = 0
Ln = 1.01
CnnLodge.ConnectionString = strCnnStoresData
Ln = 1.02
Ln = 1.021
cmd.CommandType = Data.CommandType.StoredProcedure
Ln = 1.022
Ln = 1.023
cmd.Parameters("@JDEBatchNo").Value = JDEBatchNo
Ln = 1.024
DR = cmd.ExecuteReader()
Catch ex As Exception
Errs.LogError(ex, LogFile, "chqImportLodgements Ln:" & Ln)
so in my error log I see the error and the ln number so I know where the problem occured.
Is this a good method or is it very poor programming. It does not noteable effect the program but would it be considered good practice.