storj/pkg/utils/logging.go
Dennis Coyle d6ddb65bf8 basic structure (#39)
* wip - basic structure

* cleanup

* zap logger

* handling errors | using urfav/cli

* remove deadcode

* move NewLogger to utils

* single process method

* copyright

* more generic Process

* simplified

* added NewServer Back
2018-05-16 12:47:59 -06:00

23 lines
473 B
Go

// Copyright (C) 2018 Storj Labs, Inc.
// See LICENSE for copying information.
package utils
import (
"strings"
"go.uber.org/zap"
)
// NewLogger takes an environment and a set of options for a logger
func NewLogger(e string, options ...zap.Option) (*zap.Logger, error) {
switch strings.ToLower(e) {
case "dev", "development":
return zap.NewDevelopment(options...)
case "prod", "production":
return zap.NewProduction(options...)
}
return zap.NewNop(), nil
}