![]() | ![]() Products ![]() ![]() ![]() ![]() |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB Enhancement Requests and Suggestions » View Thread |
Messages 1 to 6 of 6 total |
![]() |
Mon, Apr 21 2014 11:06 AM | Permanent Link |
Roy Lambert NLH Associates ![]() | Tim
Can we have a developer accessible log like your current system log? I think the first 4 columns of your's would be adequate. The reason for asking is that I'm needing to log things in a robust fashion so I don't want to use normal database operations in case its something I'm doing there that's screwing up and I like to do things with minimal overhead. I'd like to write to the log from inside a main app, threads, and external dlls like word generator code. Any chance? Off now to look for an interim solution. Roy Lambert |
Tue, Apr 22 2014 7:55 AM | Permanent Link |
Peter Evans | On 22/04/2014 1:06 AM, Roy Lambert wrote:
Roy, Recently I have been using the logging code that comes with the framework tiOpf. That code is in a Git Repository. Look in the Core folder, say unit 'tiLog.pas', and associated ones. The only drawback is it does put in some units. The positive is that it is thread safe. Regards, Peter Evans |
Tue, Apr 22 2014 7:57 AM | Permanent Link |
Peter Evans | On 22/04/2014 9:55 PM, Peter Evans wrote:
> > The only drawback is it does put in some units. The positive is that it > is thread safe. Meant to say "pull" instead of "put". |
Tue, Apr 22 2014 8:35 AM | Permanent Link |
Roy Lambert NLH Associates ![]() | Peter
Thanks, I'll have a look at it. Roy Lambert |
Thu, Apr 24 2014 2:19 AM | Permanent Link |
Peter Evans | Here is a simple logging unit.
The log gets created in the directory of the application. The log has a fixed file name. To use it make a call like :- gSTLog.Log('Hello'); No initialization is required. Regards, Peter Evans unit STLog; interface USES tiLog; type TSTLog = class private public CONSTRUCTOR Create; DESTRUCTOR Destroy; OVERRIDE; Procedure Log(const AMessage : string; const ASeverity : TtiLogSeverity = lsNormal); end ; // A function with application wide visibility to surface the unit wide // variable uSTLog function gSTLog : TSTLog; implementation USES tiLogToFile, System.SysUtils; var // Hold a single instance of our identifier factory uSTLog : TSTLog; //------------------------------------------------------------------------------ function gSTLog : TSTLog; begin if uSTLog = nil then begin GLog.RegisterLog( TtiLogToFile.CreateWithFileName( System.SysUtils.GetCurrentDir {FilePath}, 'ST_Test_Log.txt' {FileName}, False {OverwriteOldFile} ) ); uSTLog := TSTLog.Create; end; result := uSTLog; end; CONSTRUCTOR TSTLog.Create; BEGIN inherited Create; {Set up all the defaults} { } END;{Create} DESTRUCTOR TSTLog.Destroy; BEGIN { } inherited Destroy; {must be last} END;{Destroy} Procedure TSTLog.Log(const AMessage : string; const ASeverity : TtiLogSeverity = lsNormal); begin GLog.Log(AMessage, ASeverity); end; initialization uSTLog := Nil; finalization FreeAndNil(uSTLog); end. |
Thu, Apr 24 2014 2:50 AM | Permanent Link |
Roy Lambert NLH Associates ![]() | Peter
Thanks Roy Lambert |
This web page was last updated on Wednesday, August 14, 2024 at 03:12 PM | Privacy Policy![]() © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? ![]() |