[Ovirt-devel] [PATCH server] Add logging format to taskomatic
Ian Main
imain at redhat.com
Tue Feb 17 23:57:11 UTC 2009
On Tue, 17 Feb 2009 17:10:23 -0500
Jason Guiditta <jason.guiditta at gmail.com> wrote:
> ACK, this shows timestamp now, with one comment inline.
>
> On Tue, Feb 17, 2009 at 4:23 PM, Ian Main <imain at redhat.com> wrote:
>
> > Sadly there's a bug in rails that overrides the logger format causing
> > the non-existant formatting we were seeing. This is ugly but fixes the
> > issue.
> >
> > Signed-off-by: Ian Main <imain at redhat.com>
> > ---
> > src/task-omatic/taskomatic.rb | 13 +++++++++++++
> > 1 files changed, 13 insertions(+), 0 deletions(-)
> >
> > diff --git a/src/task-omatic/taskomatic.rb b/src/task-omatic/taskomatic.rb
> > index 65aac32..f6f7f39 100755
> > --- a/src/task-omatic/taskomatic.rb
> > +++ b/src/task-omatic/taskomatic.rb
> > @@ -35,6 +35,19 @@ require 'task_vm'
> > require 'task_storage'
> > require 'vnc'
> >
> > +# This sad and pathetic readjustment to ruby logger class is
> > +# required to fix the formatting because rails does the same
> > +# thing but overrides it to just the message.
> > +#
> > +# See eg: http://osdir.com/ml/lang.ruby.rails.core/2007-01/msg00082.html
> > +#
> > +class Logger
> > + def format_message(severity, timestamp, progname, msg)
> > + "#{timestamp} (#{$$}) #{msg}\n"
>
> Why not include severity here as in default logger, especially since it is
> passed in?
Good idea, I will make that change and push.
Ian
More information about the ovirt-devel
mailing list