Default LogEntry Items

mpappert

Regular
Joined
Oct 5, 2002
Messages
58
Location
Ottawa, ON, Canada
Hey Everyone,

I've created a logEntry Class and I want to be able to support standardized logEntries. I want an enum that will relate to an array or (preferably) a resource file. For example:

Visual Basic:
Public Enum LogEntry
   dbOpen = 1
   dbClosed = 2
End Enum

SomeArray(LogEntry.dbOpen) = "Database Connection Open"
I can think of a few methods for accomplishing this, and wondering if there is a standard practice for accomplishing this or whether it's personal preference ...

Method 1:

Create the Enum as per above, and in the LogWriteText function, use a select statement to check a property that the user could set to use a default LogEntry, and write the appropriate line to the logfile and then reset the property to 0.

Method 2:
Create a collection that the user could use when calling the LogWriteText Function as follows:

Visual Basic:
LogWriteText(colLogEntries(LogEntry.dbOpen))
This method would require a heavy initialization as I would have to cycle through the creation of the collection everytime an instance is created .. seems like overkill ...

Method 3:
Use a resource file (not sure how to do this one in VB.NET)


Thanks for your help!
M.
 
Back
Top