Bugzilla – Bug 2150
Make timestamping of log entries optional
Last modified: 2008-09-15 14:39:24 UTC
The msg() function in Slim::Utils::Misc prefixes a timestamp to the log entry. I run slimserver under supervise (from djb's daemontools) and use multilog to capture log output. I'd prefer to use the time-stamping from the multilog tool as this will add a timestamp to *all* slimserver output, not just that created withthe msg() function. I'd therefore like to be able to turn-off the timestamping in the msg() function. I could do
Created attachment 834 [details] Partial patch to make log timestamp optional This is a partial patch to make timestamping of log entries optional. It only modifies the msg() function in Slim/Utils/Misc.pm. Also required is code to manage this preference from the web interface, but I wouldn't know where to start with that!
Comment on attachment 834 [details] Partial patch to make log timestamp optional Ugh! It would help if I made sure it worked.
Created attachment 835 [details] Partial patch to make log timestamp optional I've taken the precaution of testing this time :)
For setup, start with something like this: ,'timestamplog' => { 'validate' => \&validateTrueFalse ,'options' => { '0' => string('DISABLED') ,'1' => string('ENABLED') } } Just pick where you want it to appear, under which tab, then add timestamplog to the 'PrefOrder' for the section/group. Also, you will also need strings for SETUP_TIMESTAMPLOG, and SETUP_TIMESTAMPLOG_DESC
Let's hold off on this post 6.2.
Shouldn't it be a startup parameter rather than one more option in the settings pages? I think this is definitely too exotic for mainstream. But that's just my point of view.
Absolutely. This should be a command line argument.
A command-line argument would suit me. I guess I need to investigate how to change the conditional in the patch to check for a command-line argument...
Comment on attachment 835 [details] Partial patch to make log timestamp optional Change of approach - I've added this as a command-line option: --noLogTimestamp. Patch to follow.
Created attachment 836 [details] Patch to add noLogTimestamp command-line option The attached patch against r4365 adds a command-line option to surpress the addition of a timestamp to the log output.
Comment on attachment 836 [details] Patch to add noLogTimestamp command-line option Had a few problems with semantics (not noLogtimestamp ???)
Created attachment 838 [details] Patch to add noLogTimestamp command-line option This patch adds the --noLogTimestamp command-line option. It's implemented as a negated option, so --LogTimestamp is also valid and is the default.
Comment on attachment 838 [details] Patch to add noLogTimestamp command-line option Aaarrggh - uploaded the wrong file!
Created attachment 839 [details] Patch to add noLogTimestamp command-line option This patch adds the --noLogTimestamp command-line option. It's implemented as a negated option, so --LogTimestamp is also valid and is the default.
Created attachment 965 [details] Patch to make log timestamp optional I've updated this to add the $forcelog parameter. Any chance of getting it applied?
added to trunk at change 4951 for wider testing and feedback.
had to make the small change 4951 to fix the join for a clean time string. seems to work now. probably going to just leave this as a trunk only fix.
kdf, That sounds fine. Thanks for applying, and spotting the bug! R.