-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlogger.go
More file actions
24 lines (19 loc) · 882 Bytes
/
Copy pathlogger.go
File metadata and controls
24 lines (19 loc) · 882 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package flowcore
// Logger receives lifecycle events for steps. All methods are optional to implement;
// the engine only calls what you provide via a non-nil logger.
type Logger interface {
StepStarted(workflowID, stepName string)
StepSucceeded(workflowID, stepName string)
StepFailed(workflowID, stepName string, err error)
}
// PrintLogger writes simple lines to stdout. It satisfies Logger.
type PrintLogger struct{}
func (PrintLogger) StepStarted(workflowID, stepName string) {
println("[flowcore] start workflow=" + workflowID + " step=" + stepName)
}
func (PrintLogger) StepSucceeded(workflowID, stepName string) {
println("[flowcore] ok workflow=" + workflowID + " step=" + stepName)
}
func (PrintLogger) StepFailed(workflowID, stepName string, err error) {
println("[flowcore] fail workflow=" + workflowID + " step=" + stepName + " err=" + err.Error())
}