-
-
Notifications
You must be signed in to change notification settings - Fork 137
Expand file tree
/
Copy pathNotificationContext.java
More file actions
41 lines (34 loc) · 1.05 KB
/
NotificationContext.java
File metadata and controls
41 lines (34 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package org.jenkinsci.plugins.stashNotifier;
import hudson.model.Run;
import java.io.PrintStream;
/**
* Properties from the build where this is running.
*/
public class NotificationContext {
private final PrintStream logger;
private final String runId;
private final BuildInformation buildInformation;
public NotificationContext(PrintStream logger, String runId, BuildInformation buildInformation) {
this.logger = logger;
this.runId = runId;
this.buildInformation = buildInformation;
}
/**
* Anything logged here will show up in the running build's console log.
*
* @return handle to build's log
*/
public PrintStream getLogger() {
return logger;
}
/**
* This is the {@link Run#getExternalizableId()} from the running build,
* useful for detailed server-side logging (such as through slf4j).
*
* @return build's id
*/
public String getRunId() {
return runId;
}
public BuildInformation getBuildInformation() { return buildInformation; }
}