]> Cypherpunks.ru repositories - nncp.git/blobdiff - src/log.go
Raise copyright years
[nncp.git] / src / log.go
index 97a8a8fd793ef08d7777dd18813ad4022eb730bd..7953a0227afe14836cb878ccbe10fa4020ad8539 100644 (file)
@@ -1,6 +1,6 @@
 /*
 NNCP -- Node to Node copy, utilities for store-and-forward data exchange
-Copyright (C) 2016-2021 Sergey Matveev <stargrave@stargrave.org>
+Copyright (C) 2016-2022 Sergey Matveev <stargrave@stargrave.org>
 
 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -134,6 +134,9 @@ func (ctx *Ctx) LogI(who string, les LEs, msg func(LEs) string) {
        les = append(LEs{{"Who", who}}, les...)
        les = append(les, LE{"Msg", msg(les)})
        rec := les.Rec()
+       if ctx.Debug {
+               fmt.Fprint(os.Stderr, rec)
+       }
        if !ctx.Quiet {
                fmt.Fprintln(os.Stderr, ctx.HumanizeRec(rec))
        }
@@ -144,6 +147,9 @@ func (ctx *Ctx) LogE(who string, les LEs, err error, msg func(LEs) string) {
        les = append(LEs{{"Err", err.Error()}, {"Who", who}}, les...)
        les = append(les, LE{"Msg", msg(les)})
        rec := les.Rec()
+       if ctx.Debug {
+               fmt.Fprint(os.Stderr, rec)
+       }
        if !ctx.Quiet {
                fmt.Fprintln(os.Stderr, ctx.HumanizeRec(rec))
        }