make logforward exit on error, saving buffer first
This commit is contained in:
parent
7909a17fbf
commit
33aefc1d25
6
main.go
6
main.go
|
@ -15,7 +15,6 @@ import (
|
|||
"os"
|
||||
"time"
|
||||
|
||||
"git.dnix.de/an/xlog"
|
||||
goscp "github.com/bramvdbogaerde/go-scp"
|
||||
"github.com/bramvdbogaerde/go-scp/auth"
|
||||
"golang.org/x/crypto/ssh"
|
||||
|
@ -40,7 +39,10 @@ func main() {
|
|||
time.Sleep(1 * time.Microsecond)
|
||||
line, err := reader.ReadString('\n')
|
||||
if err != nil {
|
||||
xlog.Error(err.Error())
|
||||
fmt.Printf("%s\n", err.Error())
|
||||
l := []byte(log)
|
||||
gzipAndSend(l)
|
||||
return
|
||||
} else {
|
||||
log += line
|
||||
fmt.Printf("%d\r", len(log))
|
||||
|
|
Loading…
Reference in New Issue