D.Tkalcec (RTC)
|
|
« Reply #1 on: November 23, 2014, 09:55:12 AM » |
|
If you want to change the logging folder and other global variables in the rtcLog unit before the actual logging starts, you can ...
1. Create a new unit in your Project folder. I will call it "MyDebug.pas" here, but you can call it anything you want.
2. In your new unit (myDebug.pas), ONLY use the rtcLog unit from the RTC SDK. Do NOT use any other units from the RTC SDK and do NOT use any units which might be using any RTC unit.
3. In the initialization section of your new unit, set all the logging variables to the values you want to use.
4. In your Project file (DPR), add your new unit to the "uses" clause before any other RTC or user units, so it will be loaded first.
Example "myDebug.pas" unit:
unit myDebug; interface uses rtcLog; implementation initialization // here, you can set up all the logging variables ... RTC_LOG_THREADID:=True; end.
Example myProject (DPR) modification ...
program myProject; uses // if you are using a custom memory manager like "FastMM", add it here: FastMM4, // use your new debug unit before using any other units: myDebug, // here comes the rest ...
This way, you can override all global variables in the rtcLog unit before the actual logging starts. Even though the StartLog procedure will be called from the rtcLog unit before you start changing the variables, it only sets the "doLog" variable to TRUE, but it does NOT start writing anything to disk. Only the actual use of logging functions creates log files and writes to the disk.
Best Regards, Danijel Tkalcec
|