mirror of https://bitbucket.org/ausocean/av.git
Fixed some logging stuff
This commit is contained in:
parent
d1e49e795b
commit
7edf430f9a
|
@ -219,12 +219,12 @@ func (r *revid) ChangeConfig(config Config) (err error) {
|
|||
// logger provided in the revid config - if there is one, otherwise the message
|
||||
// is sent to stdout
|
||||
func (r *revid) Log(logType, m string) {
|
||||
if r.config.Logger != nil {
|
||||
r.config.Logger.Log(logType, m)
|
||||
} else {
|
||||
if r.config.Verbosity == Yes {
|
||||
fmt.Println(logType + ": " + m)
|
||||
if r.config.Verbosity == Yes {
|
||||
if r.config.Logger != nil {
|
||||
r.config.Logger.Log(logType, m)
|
||||
return
|
||||
}
|
||||
fmt.Println(logType + ": " + m
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -326,11 +326,11 @@ func (r *revid) packClips() {
|
|||
}
|
||||
}
|
||||
|
||||
func reboot() {
|
||||
func (r* revid)reboot() {
|
||||
cmd := exec.Command("sudo", "reboot")
|
||||
err := cmd.Run()
|
||||
fmt.Println(err)
|
||||
fmt.Println("Rebooting!")
|
||||
r.Log(Error, err.Error())
|
||||
r.Log(Info, "Rebooting!")
|
||||
}
|
||||
|
||||
// outputClips takes the clips produced in the packClips method and outputs them
|
||||
|
|
Loading…
Reference in New Issue