proxy.golang.org : github.com/mongodb/grip : v0.0.0-20230103154750-e65eda150c79
Package grip provides a flexible logging package for basic Go programs. Drawing inspiration from Go and Python's standard library logging, as well as systemd's journal service, and other logging systems, Grip provides a number of very powerful logging abstractions in one high-level package. The central type of the grip package is the Journaler type, instances of which provide distinct log capturing system. For ease, following from the Go standard library, the grip package provides parallel public methods that use an internal "standard" Jouernaler instance in the grip package, which has some defaults configured and may be sufficient for many use cases. The send.Sender interface provides a way of changing the logging backend, and the send package provides a number of alternate implementations of logging systems, including: systemd's journal, logging to standard output, logging to a file, and generic syslog support. The message.Composer interface is the representation of all messages. They are implemented to provide a raw structured form as well as a string representation for more conentional logging output. Furthermore they are intended to be easy to produce, and defer more expensive processing until they're being logged, to prevent expensive operations producing messages that are below threshold. The MutiCatcher type makes it possible to collect from a group of operations and then aggregate them as a single error. Loging helpers exist for the following levels: These methods accept both strings (message content,) or types that implement the message.MessageComposer interface. Composer types make it possible to delay generating a message unless the logger is over the logging threshold. Use this to avoid expensive serialization operations for suppressed logging operations. All levels also have additional methods with `ln` and `f` appended to the end of the method name which allow Println() and Printf() style functionality. You must pass printf/println-style arguments to these methods. The Conditional logging methods take two arguments, a Boolean, and a message argument. Messages can be strings, objects that implement the MessageComposer interface, or errors. If condition boolean is true, the threshold level is met, and the message to log is not an empty string, then it logs the resolved message. Use conditional logging methods to potentially suppress log messages based on situations orthogonal to log level, with "log sometimes" or "log rarely" semantics. Combine with MessageComposers to to avoid expensive message building operations.
Registry -
Documentation -
Download -
JSON
purl: pkg:golang/github.com/mongodb/[email protected]
Published:
Indexed:
- github.com/andygrunwald/go-jira v0.0.0-20170512141550-c8c6680f245f
- github.com/coreos/go-systemd v0.0.0-20160607160209-6dc8b843c670
- github.com/dghubble/oauth1 v0.7.2
- github.com/fatih/structs v1.1.0
- github.com/fuyufjh/splunk-hec-go v0.3.4-0.20190414090710-10df423a9f36
- github.com/google/go-cmp v0.5.9
- github.com/google/go-github v17.0.0+incompatible
- github.com/google/go-querystring v1.1.0
- github.com/google/uuid v1.3.0
- github.com/mattn/go-xmpp v0.0.0-20161121012536-f4550b539938
- github.com/montanaflynn/stats v0.0.0-20180911141734-db72e6cae808
- github.com/pkg/errors v0.9.1
- github.com/shirou/gopsutil/v3 v3.21.12
- github.com/slack-go/slack v0.12.1
- github.com/stretchr/testify v1.8.1
- github.com/tklauser/go-sysconf v0.3.10
- github.com/trivago/tgo v1.0.7
- golang.org/x/oauth2 v0.0.0-20211005180243-6b3c2da341f1
- golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a
- google.golang.org/appengine v1.6.7