Package hudson.plugins.timestamper
Class TimestampNote
- java.lang.Object
-
- hudson.console.ConsoleNote<Object>
-
- hudson.plugins.timestamper.TimestampNote
-
- All Implemented Interfaces:
ExtensionPoint
,Describable<ConsoleNote<?>>
,Serializable
public final class TimestampNote extends ConsoleNote<Object>
Time-stamp console note.These are inserted into the log file when:
- Running a Pipeline build or any other build which does not extend
AbstractBuild
prior to version 1.9 OR - Running a Freestyle build or any other build which extends
AbstractBuild
prior to version 1.4 OR - Running a Freestyle build or any other build which extends
AbstractBuild
and the system property is set: (getSystemProperty()
). This is intended to support scripts that were written prior to version 1.4 to parse the log files. New scripts should query the/timestamps
URL instead (seeTimestampsAction
).
Otherwise, the time-stamps are stored in a separate file, which allows a more compact format to be used and avoids filling the log files with encoded console notes.
- Author:
- Steven G. Brown
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
-
Fields inherited from class hudson.console.ConsoleNote
INSECURE, POSTAMBLE, POSTAMBLE_STR, PREAMBLE, PREAMBLE_STR
-
-
Constructor Summary
Constructors Constructor Description TimestampNote(long elapsedMillis, long millisSinceEpoch)
Create a newTimestampNote
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ConsoleAnnotator<Object>
annotate(Object context, MarkupText text, int charPos)
static String
getSystemProperty()
Get the system property which will cause these console notes to be inserted into the console log file.Timestamp
getTimestamp(Object context)
Get the time-stamp recorded by this console note.String
toString()
static boolean
useTimestampNotes(Class<?> buildClass)
-
Methods inherited from class hudson.console.ConsoleNote
encode, encodeTo, encodeTo, findPreamble, getDescriptor, readFrom, removeNotes, removeNotes, skip
-
-
-
-
Constructor Detail
-
TimestampNote
public TimestampNote(long elapsedMillis, long millisSinceEpoch)
Create a newTimestampNote
.- Parameters:
elapsedMillis
- the elapsed time in milliseconds since the start of the buildmillisSinceEpoch
- milliseconds since the epoch
-
-
Method Detail
-
getSystemProperty
public static String getSystemProperty()
Get the system property which will cause these console notes to be inserted into the console log file.- Returns:
- the system property
-
useTimestampNotes
public static boolean useTimestampNotes(Class<?> buildClass)
- Returns:
- whether time-stamp notes apply to that type of build
-
getTimestamp
public Timestamp getTimestamp(Object context)
Get the time-stamp recorded by this console note.- Parameters:
context
- the object that owns the console output in question- Returns:
- the time-stamp
-
annotate
public ConsoleAnnotator<Object> annotate(Object context, MarkupText text, int charPos)
- Specified by:
annotate
in classConsoleNote<Object>
-
-