
September 25th, 2012, 04:06 PM
|
|
Contributing User
|
|
Join Date: Jan 2006
Location: Carlsbad, CA
|
|
|
Probably not exactly what you wanted; but you said no third party components.
Assuming that that includes the Codesite component that is part of recent Delphi versions:-
What I did (a long time ago) in the interest of not writing the same code more than once
is to build myself a small logging component that, internally, understands how to open a file, write to it and close it.
I then gave it a few properties.
FileName: String - obvious purpose
TimeStamp: Boolean - whether to add a timestamp to each entry
Enabled: Boolean - whether or not to write to the file
And some methods like:
WriteString(msg: string);
This is the bare bones.
Naturally you can add as much sophistication as you want.
HTH: Clive
|