From c6dacd6f913b4c6eb7a8917af49190dce32db108 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Tue, 8 Dec 2015 16:13:29 +0100 Subject: Add EME filename encryption & enable it by default --- cryptfs/log.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'cryptfs/log.go') 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 } -- cgit v1.2.3