Skip to content

Commit

Permalink
New prefix and log formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
kristofferahl committed Jan 26, 2024
1 parent 3279b77 commit e4f798e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/config/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type AppMetadata struct {
func NewContext(metadata AppMetadata, paths ...string) (AppContext, error) {
l := logrus.New()
l.Formatter = &PrefixedTextFormatter{
Prefix: "racoon ",
Prefix: "[racoon] ",
}

if len(paths) == 0 {
Expand Down
6 changes: 5 additions & 1 deletion internal/config/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ type PrefixedTextFormatter struct {

// Format formats the log entry
func (f *PrefixedTextFormatter) Format(entry *logrus.Entry) ([]byte, error) {
formatter := &logrus.TextFormatter{}
formatter := &logrus.TextFormatter{
DisableTimestamp: true,
PadLevelText: false,
DisableLevelTruncation: true,
}
b, err := formatter.Format(entry)
if err == nil {
if len(b) > 0 {
Expand Down

0 comments on commit e4f798e

Please sign in to comment.