Skip to content

Commit

Permalink
[logging] refs fibercrypto#298 - Add stderr and none options to SetOu…
Browse files Browse the repository at this point in the history
…tput
  • Loading branch information
AntiD2ta committed Jan 20, 2020
1 parent 4ded230 commit 8bb88cb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
11 changes: 9 additions & 2 deletions src/util/logging/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,17 @@ func Disable() {

// SetOutput call correct function given a option to set logger's output
func SetOutput(opt string) error {
if opt == "stdout" {
switch opt {
case "stdout":
SetOutputTo(os.Stderr)
return nil
} else {
case "stderr":
SetOutputTo(os.Stderr)
return nil
case "none":
SetOutputTo(NoWriter{})
return nil
default:
return SetOutputToFile(opt)
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package util

import (
"errors"
"strconv"

"github.com/fibercrypto/fibercryptowallet/src/core"
local "github.com/fibercrypto/fibercryptowallet/src/main"
"github.com/fibercrypto/fibercryptowallet/src/util/logging"
"strconv"
)

var logUtil = logging.MustGetLogger("FiberCrypto util")
Expand Down

0 comments on commit 8bb88cb

Please sign in to comment.