add a new internal hook to save ssh log (#15787)
* add a new internal hook to save ssh log as title, when a ssh error ocure like #15785. only when switch ``RUN_MODE`` to dev can we found which error is ocure. But this way is not a good idea for production envirment. this changes try save ssh error mesage to the log file like other log by a new internal hook. I think it's usefull for find error message in production envirment. Thanks. Signed-off-by: a1012112796 <[email protected]> * rename and fix nit * Update modules/private/hook.go Co-authored-by: silverwind <[email protected]> Co-authored-by: techknowlogick <[email protected]> Co-authored-by: silverwind <[email protected]> Co-authored-by: techknowlogick <[email protected]>
This commit is contained in:
co-authored by
techknowlogick
silverwind
techknowlogick
parent
35b0c8aa7d
commit
fec8324026
@@ -81,6 +81,10 @@ func fail(userMessage, logMessage string, args ...interface{}) {
|
||||
}
|
||||
}
|
||||
|
||||
if len(logMessage) > 0 {
|
||||
_ = private.SSHLog(true, fmt.Sprintf(logMessage+": ", args...))
|
||||
}
|
||||
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user