func (ctx *Ctx) checkXx(nodeId *NodeId, xx TRxTx) bool {
isBad := false
for job := range ctx.Jobs(nodeId, xx) {
- sds := SDS{"xx": string(xx), "node": nodeId, "pkt": job.Fd.Name()}
+ sds := SDS{
+ "xx": string(xx),
+ "node": nodeId,
+ "pkt": ToBase32(job.HshValue[:]),
+ }
+ ctx.LogI("check", sds, "")
gut, err := Check(job.Fd, job.HshValue[:])
job.Fd.Close()
if err != nil {
niceRaw = flag.Int("nice", 255, "Minimal required niceness")
rxOnly = flag.Bool("rx", false, "Only receive packets")
txOnly = flag.Bool("tx", false, "Only transfer packets")
+ quiet = flag.Bool("quiet", false, "Print only errors")
debug = flag.Bool("debug", false, "Enable debugging information")
version = flag.Bool("version", false, "Print version information")
warranty = flag.Bool("warranty", false, "Print warranty information")
if err != nil {
log.Fatalln("Can not parse config:", err)
}
+ ctx.Quiet = *quiet
ctx.Debug = *debug
splitted := strings.SplitN(flag.Arg(0), ":", 2)
var (
cfgPath = flag.String("cfg", nncp.DefaultCfgPath, "Path to configuration file")
nodeRaw = flag.String("node", "", "Process only that node")
+ quiet = flag.Bool("quiet", false, "Print only errors")
debug = flag.Bool("debug", false, "Enable debugging information")
version = flag.Bool("version", false, "Print version information")
warranty = flag.Bool("warranty", false, "Print warranty information")
if err != nil {
log.Fatalln("Can not parse config:", err)
}
+ ctx.Quiet = *quiet
ctx.Debug = *debug
var nodeOnly *nncp.Node
niceRaw = flag.Int("nice", 255, "Minimal required niceness")
bind = flag.String("bind", ":5400", "Address to bind to")
maxConn = flag.Int("maxconn", 128, "Maximal number of simultaneous connections")
+ quiet = flag.Bool("quiet", false, "Print only errors")
debug = flag.Bool("debug", false, "Enable debugging information")
version = flag.Bool("version", false, "Print version information")
warranty = flag.Bool("warranty", false, "Print warranty information")
if err != nil {
log.Fatalln("Can not parse config:", err)
}
+ ctx.Quiet = *quiet
ctx.Debug = *debug
ln, err := net.Listen("tcp", *bind)
var (
cfgPath = flag.String("cfg", nncp.DefaultCfgPath, "Path to configuration file")
niceRaw = flag.Int("nice", nncp.DefaultNiceMail, "Outbound packet niceness")
+ quiet = flag.Bool("quiet", false, "Print only errors")
debug = flag.Bool("debug", false, "Enable debugging information")
version = flag.Bool("version", false, "Print version information")
warranty = flag.Bool("warranty", false, "Print warranty information")
if err != nil {
log.Fatalln("Can not parse config:", err)
}
+ ctx.Quiet = *quiet
ctx.Debug = *debug
splitted := strings.SplitN(flag.Arg(1), ":", 2)
var (
cfgPath = flag.String("cfg", nncp.DefaultCfgPath, "Path to configuration file")
niceRaw = flag.Int("nice", nncp.DefaultNiceMail, "Outbound packet niceness")
+ quiet = flag.Bool("quiet", false, "Print only errors")
debug = flag.Bool("debug", false, "Enable debugging information")
version = flag.Bool("version", false, "Print version information")
warranty = flag.Bool("warranty", false, "Print warranty information")
if err != nil {
log.Fatalln("Can not parse config:", err)
}
+ ctx.Quiet = *quiet
ctx.Debug = *debug
splitted := strings.SplitN(flag.Arg(0), ":", 2)
var (
cfgPath = flag.String("cfg", nncp.DefaultCfgPath, "Path to configuration file")
niceRaw = flag.Int("nice", nncp.DefaultNiceMail, "Outbound packet niceness")
+ quiet = flag.Bool("quiet", false, "Print only errors")
debug = flag.Bool("debug", false, "Enable debugging information")
version = flag.Bool("version", false, "Print version information")
warranty = flag.Bool("warranty", false, "Print warranty information")
if err != nil {
log.Fatalln("Can not parse config:", err)
}
+ ctx.Quiet = *quiet
ctx.Debug = *debug
node, err := ctx.FindNode(flag.Arg(0))
nodeRaw = flag.String("node", "", "Process only that node")
niceRaw = flag.Int("nice", 255, "Minimal required niceness")
dryRun = flag.Bool("dryrun", false, "Do not actually write any tossed data")
+ quiet = flag.Bool("quiet", false, "Print only errors")
debug = flag.Bool("debug", false, "Enable debugging information")
version = flag.Bool("version", false, "Print version information")
warranty = flag.Bool("warranty", false, "Print warranty information")
if err != nil {
log.Fatalln("Can not parse config:", err)
}
+ ctx.Quiet = *quiet
ctx.Debug = *debug
var nodeOnly *nncp.Node
txOnly = flag.Bool("tx", false, "Only transfer packets")
force = flag.Bool("force", false, "Force outbound directories creation")
keep = flag.Bool("keep", false, "Do not delete transferred packets")
+ quiet = flag.Bool("quiet", false, "Print only errors")
debug = flag.Bool("debug", false, "Enable debugging information")
version = flag.Bool("version", false, "Print version information")
warranty = flag.Bool("warranty", false, "Print warranty information")
if err != nil {
log.Fatalln("Can not parse config:", err)
}
+ ctx.Quiet = *quiet
ctx.Debug = *debug
var nodeOnly *nncp.Node
Spool string
LogPath string
+ Quiet bool
Debug bool
NotifyFile *FromToYAML
NotifyFreq *FromToYAML
msg += ": " + err
}
case "check":
- msg = fmt.Sprintf(
- "Integrity check: %s/%s/%s %s",
- sds["node"], sds["xx"], sds["pkt"], sds["err"],
- )
+ msg = fmt.Sprintf("Checking: %s/%s/%s", sds["node"], sds["xx"], sds["pkt"])
+ if err, exists := sds["err"]; exists {
+ msg += fmt.Sprintf(" %s", err)
+ }
case "nncp-xfer":
switch sds["xx"] {
case "rx":
func (ctx *Ctx) LogI(who string, sds SDS, msg string) {
msg = msgFmt(LogLevel("I"), who, sds, msg)
- fmt.Fprintln(os.Stderr, ctx.Humanize(msg))
+ if !ctx.Quiet {
+ fmt.Fprintln(os.Stderr, ctx.Humanize(msg))
+ }
ctx.Log(msg)
}
func (ctx *Ctx) LogP(who string, sds SDS, msg string) {
- fmt.Fprintln(os.Stderr, ctx.Humanize(msgFmt(LogLevel("P"), who, sds, msg)))
+ if !ctx.Quiet {
+ fmt.Fprintln(os.Stderr, ctx.Humanize(msgFmt(LogLevel("P"), who, sds, msg)))
+ }
}
func (ctx *Ctx) LogE(who string, sds SDS, msg string) {