diff options
author | Jakob Unterwurzacher | 2015-12-08 16:13:29 +0100 |
---|---|---|
committer | Jakob Unterwurzacher | 2015-12-08 16:17:04 +0100 |
commit | c6dacd6f913b4c6eb7a8917af49190dce32db108 (patch) | |
tree | c0fd9a08f42c37bd977b95d2bb0a7c96226045c1 /cryptfs/log.go | |
parent | ff8c81f95b311eb1cd9c822202519f1a90a8cdd4 (diff) |
Add EME filename encryption & enable it by default
Diffstat (limited to 'cryptfs/log.go')
-rw-r--r-- | cryptfs/log.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/cryptfs/log.go b/cryptfs/log.go index 64dc80e..a7fe579 100644 --- a/cryptfs/log.go +++ b/cryptfs/log.go @@ -3,6 +3,7 @@ package cryptfs import ( "fmt" "strings" + "encoding/json" ) type logChannel struct { @@ -26,6 +27,18 @@ func (l *logChannel) Dump(d []byte) { fmt.Println(strings.Replace(s, "\000", "\\0", -1)) } +func (l *logChannel) JSONDump(obj interface{}) { + if !l.enabled { + return + } + b, err := json.MarshalIndent(obj, "", "\t") + if err != nil { + fmt.Println(err) + } else { + fmt.Println(string(b)) + } +} + func (l *logChannel) Enable() { l.enabled = true } |