github.com/go-logr/logr
go
pkg:golang/github.com/go-logr/logr
1,154 Dependabot PRs
about 6 hours ago
582 repositories
12 repositories
Recent PRs (filtered by: Patch PRs )
Bump the all group across 1 directory with 7 updates
cert-manager/csi-driver-spiffe #297
Bump the non-gardener-dependencies group across 1 directory with 4 updates
gardener/test-infra #689
Bump the gomod-version group across 1 directory with 13 updates
project-kessel/spicedb-operator #103
Bump github.com/go-logr/logr from 1.4.2 to 1.4.3 in the all group
rabbitmq/messaging-topology-operator #996
Chore(deps): Bump github.com/go-logr/logr from 1.4.2 to 1.4.3
spotify/flink-on-k8s-operator #905
Bump github.com/go-logr/logr from 1.4.2 to 1.4.3 in /examples/go
chore(deps): bump the go-modules group across 1 directory with 45 updates
flanksource/canary-checker #2601
feat(deps): bump github.com/go-logr/logr from 1.4.2 to 1.4.3
clastix/kamaji #825
build(deps): bump the version-updates group across 1 directory with 121 updates
mchlumsky/mracek #288
Bump github.com/go-logr/logr from 1.4.2 to 1.4.3 in the go-modules group
paketo-buildpacks/node-start #698
Bump github.com/go-logr/logr from 1.4.2 to 1.4.3
homeport/havener #796
build(deps): bump github.com/go-logr/logr from 1.4.2 to 1.4.3
nais/kafkarator #364
build(deps): bump github.com/go-logr/logr from 1.4.2 to 1.4.3
intel/intel-device-plugins-for-kubernetes #2067
Bump github.com/go-logr/logr from 1.4.2 to 1.4.3 in the all group
rabbitmq/default-user-credential-updater #140
Bump github.com/go-logr/logr from 1.4.2 to 1.4.3
gitops-tools/gitopssets-controller #269
Bump the go-modules group across 1 directory with 68 updates
paketo-buildpacks/go-mod-vendor #865
Bump the go-modules group across 1 directory with 65 updates
paketo-buildpacks/npm-install #901
build(deps): bump github.com/go-logr/logr from 1.4.2 to 1.4.3
:seedling: Bump github.com/go-logr/logr from 1.4.2 to 1.4.3
metal3-io/cluster-api-provider-metal3 #2578
build(deps): bump github.com/go-logr/logr from 1.4.2 to 1.4.3
homeport/dyff #485
build(deps): bump the gomod group across 1 directory with 43 updates
SM-100-Bench/cri-o_cri-o_8968 #7
:seedling: Bump github.com/go-logr/logr from 1.4.2 to 1.4.3
metal3-io/cluster-api-provider-metal3 #2577
Bump github.com/go-logr/logr from 1.4.2 to 1.4.3
homeport/forklift #191
:seedling: Bump github.com/go-logr/logr from 1.4.2 to 1.4.3
metal3-io/cluster-api-provider-metal3 #2575
build(deps): bump github.com/go-logr/logr from 1.4.2 to 1.4.3
rhobs/observability-operator #766
gomod(deps): bump github.com/go-logr/logr from 1.4.2 to 1.4.3
kyma-project/istio #1459
chore: bump github.com/go-logr/logr from 1.4.2 to 1.4.3
GoogleContainerTools/kpt-config-sync #1718
gomod(deps): bump github.com/go-logr/logr from 1.4.2 to 1.4.3
kyma-project/istio #1458
build(deps): bump the all group across 1 directory with 20 updates
kubernetes-sigs/cloud-provider-azure #9118
build(deps): bump the all group across 1 directory with 17 updates
kubernetes-sigs/cloud-provider-azure #9117
build(deps): bump the all group across 1 directory with 21 updates
kubernetes-sigs/cloud-provider-azure #9116
build(deps): bump the all group across 1 directory with 29 updates
jackfrancis/cloud-provider-azure #489
Bump github.com/go-logr/logr from 1.4.2 to 1.4.3
openshift-kni/lifecycle-agent #992
Bump github.com/go-logr/logr from 1.4.2 to 1.4.3 in the go-modules group
paketo-buildpacks/dotnet-core #1303
build(deps): Bump github.com/go-logr/logr from 1.4.2 to 1.4.3 in /apis
package-operator/package-operator #2013
build(deps): Bump github.com/go-logr/logr from 1.4.2 to 1.4.3
package-operator/package-operator #2012
build(deps): bump the all group across 1 directory with 17 updates
kubernetes-sigs/cloud-provider-azure #9115
build(deps): bump the all group across 1 directory with 23 updates
kubernetes-sigs/cloud-provider-azure #9114
Bump github.com/go-logr/logr from 1.4.2 to 1.4.3
ironcore-dev/ipam #457
build(deps): bump the all group across 1 directory with 20 updates
kubernetes-sigs/cloud-provider-azure #9113
build(deps): bump the all group across 1 directory with 11 updates
Azure/kube-egress-gateway #1094
Bump github.com/go-logr/logr from 1.4.2 to 1.4.3
dogmatiq/proclaim #520
build(deps): bump github.com/go-logr/logr from 1.4.2 to 1.4.3
cryostatio/cryostat-operator #1122
Bump github.com/go-logr/logr from 1.4.2 to 1.4.3
twz123/k0s-testo #21
Bump github.com/go-logr/logr from 1.4.2 to 1.4.3 in the go-modules group
paketo-buildpacks/source-removal #499
chore(deps): bump github.com/go-logr/logr from 1.4.2 to 1.4.3
package-operator/boxcutter #191
Bump github.com/go-logr/logr from 1.4.2 to 1.4.3
ironcore-dev/libvirt-provider #575
Bump the go-modules group across 1 directory with 65 updates
paketo-buildpacks/node-engine #1183
Package Details
| Name: | github.com/go-logr/logr |
| Ecosystem: | go |
| PURL Type: | golang |
| Package URL: | pkg:golang/github.com/go-logr/logr |
| JSON API: | View JSON |
Package Information
Package logr defines a general-purpose logging API and abstract interfaces to back that API. Packages in the Go ecosystem can depend on this package, while callers can implement logging with whatever backend is appropriate. Logging is done using a Logger instance. Logger is a concrete type with methods, which defers the actual logging to a LogSink interface. The main methods of Logger are Info() and Error(). Arguments to Info() and Error() are key/value pairs rather than printf-style formatted strings, emphasizing "structured logging". With Go's standard log package, we might write: With logr's structured logging, we'd write: Errors are much the same. Instead of: We'd write: Info() and Error() are very similar, but they are separate methods so that LogSink implementations can choose to do things like attach additional information (such as stack traces) on calls to Error(). Error() messages are always logged, regardless of the current verbosity. If there is no error instance available, passing nil is valid. Often we want to log information only when the application in "verbose mode". To write log lines that are more verbose, Logger has a V() method. The higher the V-level of a log line, the less critical it is considered. Log-lines with V-levels that are not enabled (as per the LogSink) will not be written. Level V(0) is the default, and logger.V(0).Info() has the same meaning as logger.Info(). Negative V-levels have the same meaning as V(0). Error messages do not have a verbosity level and are always logged. Where we might have written: We can write: Logger instances can have name strings so that all messages logged through that instance have additional context. For example, you might want to add a subsystem name: The WithName() method returns a new Logger, which can be passed to constructors or other functions for further use. Repeated use of WithName() will accumulate name "segments". These name segments will be joined in some way by the LogSink implementation. It is strongly recommended that name segments contain simple identifiers (letters, digits, and hyphen), and do not contain characters that could muddle the log output or confuse the joining operation (e.g. whitespace, commas, periods, slashes, brackets, quotes, etc). Logger instances can store any number of key/value pairs, which will be logged alongside all messages logged through that instance. For example, you might want to create a Logger instance per managed object: With the standard log package, we might write: With logr we'd write: Logger has very few hard rules, with the goal that LogSink implementations might have a lot of freedom to differentiate. There are, however, some things to consider. The log message consists of a constant message attached to the log line. This should generally be a simple description of what's occurring, and should never be a format string. Variable information can then be attached using named values. Keys are arbitrary strings, but should generally be constant values. Values may be any Go value, but how the value is formatted is determined by the LogSink implementation. Logger instances are meant to be passed around by value. Code that receives such a value can call its methods without having to check whether the instance is ready for use. The zero logger (= Logger{}) is identical to Discard() and discards all log entries. Code that receives a Logger by value can simply call it, the methods will never crash. For cases where passing a logger is optional, a pointer to Logger should be used. Keys are not strictly required to conform to any specification or regex, but it is recommended that they: These guidelines help ensure that log data is processed properly regardless of the log implementation. For example, log implementations will try to output JSON data or will store data for later database (e.g. SQL) queries. While users are generally free to use key names of their choice, it's generally best to avoid using the following keys, as they're frequently used by implementations: Implementations are encouraged to make use of these keys to represent the above concepts, when necessary (for example, in a pure-JSON output form, it would be necessary to represent at least message and timestamp as ordinary named values). Implementations may choose to give callers access to the underlying logging implementation. The recommended pattern for this is: Logger grants access to the sink to enable type assertions like this: Custom `With*` functions can be implemented by copying the complete Logger struct and replacing the sink in the copy: Don't use New to construct a new Logger with a LogSink retrieved from an existing Logger. Source code attribution might not work correctly and unexported fields in Logger get lost. Beware that the same LogSink instance may be shared by different logger instances. Calling functions that modify the LogSink will affect all of those.
| Repository: | https://github.com/go-logr/logr |
| Homepage: | https://github.com/go-logr/logr |
| Latest Release: |
v1.4.3
7 months ago |
| Dependent Repos: | 50,012 |
| Dependent Packages: | 36,835 |
| Ranking: | Top 0.0239% by dependent repos Top 0.0085% by dependent pkgs |