-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Maya Sergeeva
committed
Jun 17, 2022
1 parent
3ced5ef
commit 96ae01f
Showing
9 changed files
with
145 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,33 @@ | ||
module github.com/spacetab-io/commands-go | ||
|
||
go 1.16 | ||
go 1.17 | ||
|
||
require ( | ||
github.com/jackc/pgx/v4 v4.13.0 | ||
github.com/pressly/goose v2.7.0+incompatible | ||
github.com/spacetab-io/configuration-go v1.2.0 | ||
github.com/spacetab-io/configuration-structs-go v0.1.1 | ||
github.com/spacetab-io/logs-go/v2 v2.1.0 | ||
github.com/spacetab-io/configuration-structs-go/v2 v2.0.0-alpha2 | ||
github.com/spacetab-io/logs-go/v3 v3.0.0-alpha2 | ||
github.com/spf13/cobra v1.2.1 | ||
go.uber.org/zap v1.21.0 | ||
) | ||
|
||
//replace github.com/spacetab-io/configuration-structs-go => ../configuration-structs-go | ||
require ( | ||
github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d // indirect | ||
github.com/getsentry/sentry-go v0.13.0 // indirect | ||
github.com/inconshreveable/mousetrap v1.0.0 // indirect | ||
github.com/jackc/chunkreader/v2 v2.0.1 // indirect | ||
github.com/jackc/pgconn v1.10.0 // indirect | ||
github.com/jackc/pgio v1.0.0 // indirect | ||
github.com/jackc/pgpassfile v1.0.0 // indirect | ||
github.com/jackc/pgproto3/v2 v2.1.1 // indirect | ||
github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b // indirect | ||
github.com/jackc/pgtype v1.8.1 // indirect | ||
github.com/pkg/errors v0.9.1 // indirect | ||
github.com/spf13/pflag v1.0.5 // indirect | ||
go.uber.org/atomic v1.7.0 // indirect | ||
go.uber.org/multierr v1.6.0 // indirect | ||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 // indirect | ||
golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac // indirect | ||
golang.org/x/text v0.3.7 // indirect | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package log | ||
|
||
import ( | ||
"os" | ||
|
||
cfgstructs "github.com/spacetab-io/configuration-structs-go/v2" | ||
"github.com/spacetab-io/configuration-structs-go/v2/contracts" | ||
log "github.com/spacetab-io/logs-go/v3" | ||
"go.uber.org/zap" | ||
) | ||
|
||
var Logger, _ = log.Init( | ||
&cfgstructs.Logs{Level: "debug", Format: "text", Colored: true, Caller: cfgstructs.CallerConfig{Show: true, SkipFrames: 1}, Sentry: nil}, | ||
"unknown", "uptimeMaster", "unknown", os.Stdout) | ||
|
||
func Init(cfg contracts.LogsCfgInterface, stage, serviceAlias, serviceVersion string) (err error) { | ||
l, err := log.Init(cfg, stage, serviceAlias, serviceVersion, os.Stdout) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
Logger = l | ||
|
||
return nil | ||
} | ||
|
||
func Debug() *log.Event { return Logger.Debug() } | ||
func Info() *log.Event { return Logger.Info() } | ||
func Warn() *log.Event { return Logger.Warn() } | ||
func Error() *log.Event { return Logger.Error() } | ||
func Fatal() *log.Event { return Logger.Fatal() } | ||
func GetLogger() *zap.Logger { | ||
l := *Logger.Logger | ||
return &l | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters