openfaas / of-watchdog

Reverse proxy for STDIO and HTTP microservices
MIT License
259 stars 115 forks source link

empty log line #83

Closed fopina closed 4 years ago

fopina commented 4 years ago

bingLoggingPipe prints empty line (even without timestamp) when printing stdout/stderr from function

Expected Behaviour

I would expect empty lines to be ignored or properly timestamped to keep the line structure (for log collectors)

Current Behaviour

With this in a function handler:

fmt.Println("hello")
fmt.Print(" there")
fmt.Println(", world")

the function container output is

Forking - ./handler []
2019/09/21 16:10:53 OperationalMode: http
2019/09/21 16:10:53 Started logging stderr from function.
2019/09/21 16:10:53 Started logging stdout from function.
2019/09/21 16:10:53 Writing lock-file to: /tmp/.lock
2019/09/21 16:10:53 Metrics server. Port: 8081
2019/09/21 16:12:01 stdout: hello

2019/09/21 16:12:01 stdout:  there
2019/09/21 16:12:01 stdout: , world

(2 blank lines due to \r\n of the Println)

Possible Solution

Right-strip scanner.Text()?

Steps to Reproduce (for bugs)

Provided in Current behaviour

fopina commented 4 years ago

invalid issue, sorry. noticed I was using 0.5.3 in my template after opening this, tested with 0.7.2 and all good!