summaryrefslogtreecommitdiff
path: root/internal/tlog
diff options
context:
space:
mode:
Diffstat (limited to 'internal/tlog')
-rw-r--r--internal/tlog/log.go19
1 files changed, 16 insertions, 3 deletions
diff --git a/internal/tlog/log.go b/internal/tlog/log.go
index a770df8..8db3de2 100644
--- a/internal/tlog/log.go
+++ b/internal/tlog/log.go
@@ -12,21 +12,34 @@ import (
)
const (
+ // ProgramName is used in log reports.
ProgramName = "gocryptfs"
wpanicMsg = "-wpanic turns this warning into a panic: "
)
// Escape sequences for terminal colors. These will be empty strings if stdout
// is not a terminal.
-var ColorReset, ColorGrey, ColorRed, ColorGreen, ColorYellow string
+var (
+ // ColorReset is used to reset terminal colors.
+ ColorReset string
+ // ColorGrey is a terminal color setting string.
+ ColorGrey string
+ // ColorRed is a terminal color setting string.
+ ColorRed string
+ // ColorGreen is a terminal color setting string.
+ ColorGreen string
+ // ColorYellow is a terminal color setting string.
+ ColorYellow string
+)
+// JSONDump writes the object in json form.
func JSONDump(obj interface{}) string {
b, err := json.MarshalIndent(obj, "", "\t")
if err != nil {
return err.Error()
- } else {
- return string(b)
}
+
+ return string(b)
}
// toggledLogger - a Logger than can be enabled and disabled