1
0
Fork 0

Use daemon name as log prefix

This commit is contained in:
Gregory Eremin 2016-07-19 17:30:10 +02:00
parent a578ee9eaa
commit a1cf8bc689
1 changed files with 2 additions and 2 deletions

View File

@ -162,14 +162,14 @@ func (d *BaseDaemon) Continue() bool {
// Log logs values using shezmu.Logger.Println function.
func (d *BaseDaemon) Log(v ...interface{}) {
if d.logger != nil {
d.logger.Println(v...)
d.logger.Println(append([]interface{}{"[" + d.String() + "]"}, v...)...)
}
}
// Logf logs values using shezmu.Logger.Printf function.
func (d *BaseDaemon) Logf(format string, v ...interface{}) {
if d.logger != nil {
d.logger.Printf(format, v...)
d.logger.Printf("["+d.String()+"] "+format, v...)
}
}