You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the end of logging, we get a weird percent sign. This is likely due to some of the line trimming that happens.
here's the example go program:
funcmain() {
l, err:=gopherlogs.NewLogger(
gopherlogs.WithLogLevel(0),
)
iferr!=nil {
panic("New logger could not be created!")
}
l.Event(emojis.WrenchEmoji, " Starting application")
// start a go routine with some animated logsctx, cancel:=context.WithCancel(context.Background())
gofunc(ctx context.Context) {
l.Style(3, colors.FgYellow).AnimateProgressWithOptions(
gopherlogs.AnimatorWithContext(ctx),
gopherlogs.AnimatorWithMaxLen(3),
gopherlogs.AnimatorWithMessagef("abcdefghijklmnopqrstuvwxyz0123456789: %s", "test line 1"),
)
}(ctx)
// Do some "work" in this thread and cancel the context once it's done.time.Sleep(time.Second*3)
cancel()
l.Style(3, colors.FgGreen).ReplaceLinef("Stuff is all done!")
// start a go routine with some animated logsctx, cancel=context.WithCancel(context.Background())
gofunc(ctx context.Context) {
l.Style(3, colors.FgYellow).AnimateProgressWithOptions(
gopherlogs.AnimatorWithContext(ctx),
gopherlogs.AnimatorWithMaxLen(3),
gopherlogs.AnimatorWithMessagef("abcdefghijklmnopqrstuvwxyz0123456789: %s", "test line 2"),
)
}(ctx)
// Do some "work" in this thread and cancel the context once it's done.time.Sleep(time.Second*3)
cancel()
l.Style(3, colors.FgGreen).ReplaceLinef("More stuff is all done!")
l.Style(0, colors.FgCyan).Eventf(emojis.GreenCheckEmoji, " All done! Thanks for using gopherlogs!!")
}
And here's the output:
❯ go run main.go
🔧 Starting application
Stuff is all done!
More stuff is all done!
✅ All done! Thanks for using gopherlogs!!%
Notice the % at the end of the logging there
The text was updated successfully, but these errors were encountered:
At the end of logging, we get a weird percent sign. This is likely due to some of the line trimming that happens.
here's the example go program:
And here's the output:
Notice the
%
at the end of the logging thereThe text was updated successfully, but these errors were encountered: