logging intented hook invocation

This commit is contained in:
Shlomi Noach 2016-08-25 14:42:49 +02:00
parent cbdec6bd39
commit 2c9d71570f

View File

@ -1,3 +1,4 @@
/*
/*
Copyright 2016 GitHub Inc.
See https://github.com/github/gh-ost/blob/master/LICENSE
@ -89,6 +90,7 @@ func (this *HooksExecutor) executeHooks(baseName string, extraVariables ...strin
return err
}
for _, hook := range hooks {
log.Infof("executing %+v hook: %+v", baseName, hook)
if err := this.executeHook(hook, extraVariables...); err != nil {
return err
}
@ -137,9 +139,11 @@ func (this *HooksExecutor) onFailure() error {
}
func (this *HooksExecutor) onStatus(statusMessage string, elapsedSeconds int64) error {
v0 := fmt.Sprintf("GH_OST_STATUS='%s'", statusMessage)
v1 := fmt.Sprintf("GH_OST_ELAPSED_SECONDS='%d'", elapsedSeconds)
return this.executeHooks(onStatus, v0, v1)
v := []string{
fmt.Sprintf("GH_OST_STATUS='%s'", statusMessage),
fmt.Sprintf("GH_OST_ELAPSED_SECONDS='%d'", elapsedSeconds),
}
return this.executeHooks(onStatus, v...)
}
func (this *HooksExecutor) onStopReplication() error {