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"
|
"os"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"git.dnix.de/an/xlog"
|
|
||||||
goscp "github.com/bramvdbogaerde/go-scp"
|
goscp "github.com/bramvdbogaerde/go-scp"
|
||||||
"github.com/bramvdbogaerde/go-scp/auth"
|
"github.com/bramvdbogaerde/go-scp/auth"
|
||||||
"golang.org/x/crypto/ssh"
|
"golang.org/x/crypto/ssh"
|
||||||
|
@ -40,7 +39,10 @@ func main() {
|
||||||
time.Sleep(1 * time.Microsecond)
|
time.Sleep(1 * time.Microsecond)
|
||||||
line, err := reader.ReadString('\n')
|
line, err := reader.ReadString('\n')
|
||||||
if err != nil {
|
if err != nil {
|
||||||
xlog.Error(err.Error())
|
fmt.Printf("%s\n", err.Error())
|
||||||
|
l := []byte(log)
|
||||||
|
gzipAndSend(l)
|
||||||
|
return
|
||||||
} else {
|
} else {
|
||||||
log += line
|
log += line
|
||||||
fmt.Printf("%d\r", len(log))
|
fmt.Printf("%d\r", len(log))
|
||||||
|
|
Loading…
Reference in New Issue