planetmint-go/util/logger.go
Julian Strobl f18d4542e2
Merge release_0_5 branch (#202)
* Fix liuqid notarization (#191)

* Fix liuqid notarization - 2nd part (#193)

* fixed missing unmarshaling
* fixed message formatting issue

* fixed config parsing issue (#194)

* [util] Supply fees

But only where we want to see the transaction succeed. The other ones we
let in a broken state.

* Added logger a logger struct to log with a TAG (#198)

Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
Signed-off-by: Julian Strobl <jmastr@mailbox.org>
Co-authored-by: Jürgen Eckel <eckelj@users.noreply.github.com>
2023-11-28 10:22:39 +01:00

30 lines
740 B
Go

package util
import sdk "github.com/cosmos/cosmos-sdk/types"
type AppLogger struct {
}
var globalApplicationLoggerTag string
func init() {
// Initialize the package-level variable
globalApplicationLoggerTag = "[app] "
}
func GetAppLogger() *AppLogger {
return &AppLogger{}
}
func (logger *AppLogger) Info(ctx sdk.Context, msg string, keyvals ...interface{}) {
ctx.Logger().Info(globalApplicationLoggerTag+msg, keyvals...)
}
func (logger *AppLogger) Debug(ctx sdk.Context, msg string, keyvals ...interface{}) {
ctx.Logger().Debug(globalApplicationLoggerTag+msg, keyvals...)
}
func (logger *AppLogger) Error(ctx sdk.Context, msg string, keyvals ...interface{}) {
ctx.Logger().Error(globalApplicationLoggerTag+msg, keyvals...)
}