You are not logged in.
Hello Arnaud,
I'm using the source downloaded less than 2 weeks ago, and noticed that code like this:
TSynLog.Log(sllError, 'a test msg')
always add very long stack trace after the log msg? Example result:
20140603 20491541 a test msg, stack trace API 006A0063 BaseBackgroundWorker.TBaseBackgroundWorker.SendLogToFile (109) 0069FFA9
Note the above log message and the stack trace are in the same line.
I have tried adding NOEXCEPTIONINTERCEPT conditional define to the project option, the result is the same.
How to disable these stack traces? Thanks.
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
well, tested the latest source downloaded ten minutes ago, it's the same problem.
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
For those who have the same question, here is the solution.
FLogger.GenericFamily.LevelStackTrace := [];
PS,
FLogger.Family.LevelStackTrace := [];
doesn't work, what's the difference between
TSynLog.Family
and
TSynLog.GenericFamily
, how do I know when to use which one?
Thanks, Arnaud.
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
A further comment to ab, when auto-appending stack trace is enabled in TSynLog, I expect the log reader, TSynLogFile.EventText[aIndex] to return only the log message, but not with the very long stack trace, and this behavior is why I asked this question at the first place. Is this by design, or a bug or anything I misunderstood? Thanks.
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
I suppose your FLogger is a TSynLog instance, not a TSynLog class instance.
This is why Family / GenericFamily do not return the same value.
TSynLogFile.EventText[] returns the whole log message line.
In the log viewer application, you have one message per line, so it is convenient to use.
The stack trace is expanded in the bottom detailed memo.
So it depends on your application to retrieve the needed information, but EventText[] returns all you need.
Online
yes, I use a TSynLog instance, but not directly the class.
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline