Print Page | Close Window

TMSLogger Outputformats and global logginglevel

Printed From: TMS Software
Category: General
Forum Name: Feature Requests
Forum Discription:
URL: http://www.tmssoftware.com/site/forum/forum_posts.asp?TID=6182
Printed Date: 19 Feb 2020 at 2:54pm


Topic: TMSLogger Outputformats and global logginglevel
Posted By: Ronald Janse
Subject: TMSLogger Outputformats and global logginglevel
Date Posted: 05 Feb 2016 at 10:37am
I would like to have the opportunity to set a different format for different outputs. E.g. when using a textfile, i use a '| ' to seperate the fields. I don't like that in HTML or CSV output.

A second request would be a global logginglevel. The level will be set when initialising the logging (say: 0=low, 1=medium, 2=high etc.) and different logging statement can get a logginglevel. This way one can include very detailed logging if necessary (in debug mode or some extreme debuggingmode), and can switch it off when it's not necessary. We like to have the opportunity to provide our customers with a version that has more debugging to find local errors that are difficult to track.



Replies:
Posted By: Pieter Scheldeman
Date Posted: 05 Feb 2016 at 11:51am
Hi, 

To solve the first issue, you could create multiple instances of the TMSLogger, have one outputhandler for each instance and set the OutputFormats property based on the output handler of your choice.

The global log level is already available through the LogLevelFilters property. This way you can control which log levels are logged. 

Kind Regards, 
Pieter


Posted By: Ronald Janse
Date Posted: 05 Feb 2016 at 12:03pm
The first suggestion could work, I think. I'll try that.

The second one is not enough for me. I know that I can filter out types of information, but I would like to have a level on top of that. The extra level could give me the opportunity to log several types of Debug information, for instance.
I can solve it myself, if I can set a global value. Just an ID (string or integer, doesn't matter), like Delphi's Tag-value would do the trick. But even that is not available it seems.


Posted By: Pieter Scheldeman
Date Posted: 05 Feb 2016 at 12:07pm
You could create 2 debug loggers, one for normal debug levels and the second for detailed debug levels. With the active property you can control which one is active. They could both point to the same output handler. 



Print Page | Close Window