1
0
mirror of https://blitiri.com.ar/repos/chasquid synced 2025-12-18 14:47:03 +00:00

Reopen logs on SIGHUP

This makes it possible to manage chasquid logs using logrotate.

Amended-by: Alberto Bertogli <albertito@blitiri.com.ar>
  Added tests, minor style and comment changes.
This commit is contained in:
ThinkChaos
2020-05-21 01:53:26 +02:00
committed by Alberto Bertogli
parent ade107f62e
commit db810084a0
3 changed files with 67 additions and 0 deletions

View File

@@ -81,6 +81,11 @@ func (l *Logger) printf(format string, args ...interface{}) {
}
}
// Reopen the underlying logger.
func (l *Logger) Reopen() error {
return l.inner.Reopen()
}
// Listening logs that the daemon is listening on the given address.
func (l *Logger) Listening(a string) {
l.printf("daemon listening on %s\n", a)