Bug 2150 - Make timestamping of log entries optional
: Make timestamping of log entries optional
Status: RESOLVED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Misc
: unspecified
: PC All
: P2 normal (vote)
: ---
Assigned To: Blackketter Dean
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-09-19 06:27 UTC by Robin Bowes
Modified: 2008-09-15 14:39 UTC (History)
0 users

See Also:
Category: ---


Attachments
Partial patch to make log timestamp optional (733 bytes, patch)
2005-09-19 07:15 UTC, Robin Bowes
Details | Diff
Partial patch to make log timestamp optional (737 bytes, patch)
2005-09-19 07:19 UTC, Robin Bowes
Details | Diff
Patch to add noLogTimestamp command-line option (1.74 KB, patch)
2005-09-19 15:41 UTC, Robin Bowes
Details | Diff
Patch to add noLogTimestamp command-line option (1.74 KB, patch)
2005-09-19 16:38 UTC, Robin Bowes
Details | Diff
Patch to add noLogTimestamp command-line option (1.87 KB, patch)
2005-09-19 16:41 UTC, Robin Bowes
Details | Diff
Patch to make log timestamp optional (1.91 KB, patch)
2005-10-29 15:13 UTC, Robin Bowes
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Robin Bowes 2005-09-19 06:27:39 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
Comment 1 Robin Bowes 2005-09-19 07:15:01 UTC
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 2 Robin Bowes 2005-09-19 07:17:53 UTC
Comment on attachment 834 [details]
Partial patch to make log timestamp optional

Ugh! It would help if I made sure it worked.
Comment 3 Robin Bowes 2005-09-19 07:19:05 UTC
Created attachment 835 [details]
Partial patch to make log timestamp optional

I've taken the precaution of testing this time :)
Comment 4 KDF 2005-09-19 10:14:30 UTC
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
Comment 5 Blackketter Dean 2005-09-19 10:53:07 UTC
Let's hold off on this post 6.2.
Comment 6 Michael Herger 2005-09-19 12:38:46 UTC
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.
Comment 7 Blackketter Dean 2005-09-19 12:59:01 UTC
Absolutely.  This should be a command line argument.
Comment 8 Robin Bowes 2005-09-19 14:43:50 UTC
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 9 Robin Bowes 2005-09-19 15:18:04 UTC
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.
Comment 10 Robin Bowes 2005-09-19 15:41:52 UTC
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 11 Robin Bowes 2005-09-19 16:36:49 UTC
Comment on attachment 836 [details]
Patch to add noLogTimestamp command-line option

Had a few problems with semantics (not noLogtimestamp ???)
Comment 12 Robin Bowes 2005-09-19 16:38:16 UTC
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 13 Robin Bowes 2005-09-19 16:40:58 UTC
Comment on attachment 838 [details]
Patch to add noLogTimestamp command-line option

Aaarrggh - uploaded the wrong file!
Comment 14 Robin Bowes 2005-09-19 16:41:43 UTC
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.
Comment 15 Robin Bowes 2005-10-29 15:13:34 UTC
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?
Comment 16 KDF 2005-10-30 11:39:08 UTC
added to trunk at change 4951 for wider testing and feedback.
Comment 17 KDF 2005-10-31 14:20:52 UTC
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.
Comment 18 Robin Bowes 2005-11-01 02:08:13 UTC
kdf,

That sounds fine. Thanks for applying, and spotting the bug!

R.