Extension point for console timestamping

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Extension point for console timestamping

Sami Tikka
Hello! I'm trying to build my first Hudson plugin, a plugin to
timestamp the lines of the console log.

I've found that one can add ConsoleNotes into the log and they get
serialized to the log file and the ConsoleNotes get rendered upon
reading. That sounds useful.

But I have not found an extension point where I could insert code that
adds a ConsoleNote to the log stream for every line. If I have
understood everything I read, there is no such extension point at the
moment.

Is there a way to add ConsoleNotes from a plugin? And if there isn't,
is there an alternative way to go adding timestamps to the console
log?

-- Sami

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Extension point for console timestamping

Andrew Bayer
ConsoleAnnotationDescriptor seems to be what you're looking for - it's an extension point for descriptors of ConsoleNotes.

A.

On Thu, Jul 22, 2010 at 1:20 PM, Sami Tikka <[hidden email]> wrote:
Hello! I'm trying to build my first Hudson plugin, a plugin to
timestamp the lines of the console log.

I've found that one can add ConsoleNotes into the log and they get
serialized to the log file and the ConsoleNotes get rendered upon
reading. That sounds useful.

But I have not found an extension point where I could insert code that
adds a ConsoleNote to the log stream for every line. If I have
understood everything I read, there is no such extension point at the
moment.

Is there a way to add ConsoleNotes from a plugin? And if there isn't,
is there an alternative way to go adding timestamps to the console
log?

-- Sami

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: Extension point for console timestamping

Mike Dillon-5
I don't think this is enough.

In order to figure out when each line was reached, there would also need
to be a way to decorate the BuildListener to add these ConsoleNotes
programmatically, unless they could be derived from the stream contents
itself.  Currently, the creation of a StreamBuildListener is hard-coded
in hudson.model.Run.

Depending on how general this plugin is supposed to be, you may be able
to get away with timestamping every N seconds or something. My ideal for
such things is to only annotate the log at times that correspond to
significant changes in the build progress; in some cases you can do this
by parsing the log contents.

-md

begin Andrew Bayer quotation:

> ConsoleAnnotationDescriptor seems to be what you're looking for - it's an extension point for descriptors of ConsoleNotes.
>
> A.
>
> On Thu, Jul 22, 2010 at 1:20 PM, Sami Tikka <[hidden email]<mailto:[hidden email]>> wrote:
> Hello! I'm trying to build my first Hudson plugin, a plugin to
> timestamp the lines of the console log.
>
> I've found that one can add ConsoleNotes into the log and they get
> serialized to the log file and the ConsoleNotes get rendered upon
> reading. That sounds useful.
>
> But I have not found an extension point where I could insert code that
> adds a ConsoleNote to the log stream for every line. If I have
> understood everything I read, there is no such extension point at the
> moment.
>
> Is there a way to add ConsoleNotes from a plugin? And if there isn't,
> is there an alternative way to go adding timestamps to the console
> log?
>
> -- Sami
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]<mailto:[hidden email]>
> For additional commands, e-mail: [hidden email]<mailto:[hidden email]>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Extension point for console timestamping

Sami Tikka
Thanks. This was my concern exactly, I just could not formulate it well enough.

My build scripts currently print some timestamps here and there, so
I'll get by with that. I just thought it would have been nice to
remove the need to add timestamp printing here and there by creating a
plugin that could timestamp the whole log.

But, as this is impossible, I'll turn my interest elsewhere. Thanks for helping!

-- Sami

2010/7/22 Mike Dillon <[hidden email]>:

> I don't think this is enough.
>
> In order to figure out when each line was reached, there would also need
> to be a way to decorate the BuildListener to add these ConsoleNotes
> programmatically, unless they could be derived from the stream contents
> itself.  Currently, the creation of a StreamBuildListener is hard-coded
> in hudson.model.Run.
>
> Depending on how general this plugin is supposed to be, you may be able
> to get away with timestamping every N seconds or something. My ideal for
> such things is to only annotate the log at times that correspond to
> significant changes in the build progress; in some cases you can do this
> by parsing the log contents.
>
> -md
>
> begin Andrew Bayer quotation:
>> ConsoleAnnotationDescriptor seems to be what you're looking for - it's an extension point for descriptors of ConsoleNotes.
>>
>> A.
>>
>> On Thu, Jul 22, 2010 at 1:20 PM, Sami Tikka <[hidden email]<mailto:[hidden email]>> wrote:
>> Hello! I'm trying to build my first Hudson plugin, a plugin to
>> timestamp the lines of the console log.
>>
>> I've found that one can add ConsoleNotes into the log and they get
>> serialized to the log file and the ConsoleNotes get rendered upon
>> reading. That sounds useful.
>>
>> But I have not found an extension point where I could insert code that
>> adds a ConsoleNote to the log stream for every line. If I have
>> understood everything I read, there is no such extension point at the
>> moment.
>>
>> Is there a way to add ConsoleNotes from a plugin? And if there isn't,
>> is there an alternative way to go adding timestamps to the console
>> log?
>>
>> -- Sami
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]<mailto:[hidden email]>
>> For additional commands, e-mail: [hidden email]<mailto:[hidden email]>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]