Introduce debug tags and debug breaks

The environment variable DEBUG_TAGS can be used to control what is
printed on stderr. Example:

    DEBUG_TAGS="+all,-Archiver.*" ./restic backup foo

The variable DEBUG_BREAK can be used to set a breakpoint (implemented
using SIGSTOP):

    DEBUG_BREAK=Archiver.Snapshot ./restic backup foo
This commit is contained in:
Alexander Neumann
2015-01-11 14:09:44 +01:00
parent 203a911de9
commit 48751e1935
5 changed files with 134 additions and 32 deletions

2
map.go
View File

@@ -85,7 +85,7 @@ func (bl *Map) Insert(blob Blob) Blob {
bl.m.Lock()
defer bl.m.Unlock()
debug(" Map<%p> insert %v", bl, blob)
debug("Map.Insert", " Map<%p> insert %v", bl, blob)
return bl.insert(blob)
}