Package hudson.plugins.timestamper
Class TimestampNote
- All Implemented Interfaces:
ExtensionPoint
,Describable<ConsoleNote<?>>
,Serializable
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:
-
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
ConstructorsConstructorDescriptionTimestampNote
(long elapsedMillis, long millisSinceEpoch) Create a newTimestampNote
. -
Method Summary
Modifier and TypeMethodDescriptionannotate
(Object context, MarkupText text, int charPos) static String
Get the system property which will cause these console notes to be inserted into the console log file.getTimestamp
(Object context) Get the time-stamp recorded by this console note.toString()
static boolean
useTimestampNotes
(Class<?> buildClass) Methods inherited from class hudson.console.ConsoleNote
encode, encodeTo, encodeTo, findPreamble, getDescriptor, readFrom, removeNotes, removeNotes, skip
-
Constructor Details
-
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 Details
-
getSystemProperty
Get the system property which will cause these console notes to be inserted into the console log file.- Returns:
- the system property
-
useTimestampNotes
- Returns:
- whether time-stamp notes apply to that type of build
-
getTimestamp
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
- Specified by:
annotate
in classConsoleNote<Object>
-
toString
-