Skip to content

Commit

Permalink
log to stdout
Browse files Browse the repository at this point in the history
  • Loading branch information
esilva-everbridge committed Sep 14, 2018
1 parent 9df49e9 commit 0e1f606
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,8 @@ var appCommands = []cli.Command{
}

func main() {
logger.Out = os.Stdout

gpgHome := os.Getenv("GNUPGHOME")
if gpgHome != "" {
defaultPubRing = fmt.Sprintf("%s/pubring.gpg", gpgHome)
Expand Down
1 change: 1 addition & 0 deletions pki/pki.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ type Pki struct {

// New returns a pki object
func New(pgpKeyName string, publicKeyRing string, secretKeyRing string) Pki {
logger.Out = os.Stdout
var err error

p := Pki{publicKeyRing, secretKeyRing, pgpKeyName, nil, nil, nil, nil}
Expand Down
1 change: 1 addition & 0 deletions sls/sls.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ type Sls struct {

// New returns a Sls object
func New(filePath string, p pki.Pki, encPath string) Sls {
logger.Out = os.Stdout
s := Sls{filePath, yaml.New(), &p, false, encPath, map[string]interface{}{}, nil}
if len(filePath) > 0 {
err := s.ReadSlsFile()
Expand Down
4 changes: 4 additions & 0 deletions utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ import (

var logger = logrus.New()

func init() {
logger.Out = os.Stdout
}

// SafeWrite checks that there is no error priot to trying to write a file
func SafeWrite(buffer bytes.Buffer, outputFilePath string, err error) {
if err != nil {
Expand Down

0 comments on commit 0e1f606

Please sign in to comment.