aboutsummaryrefslogtreecommitdiffhomepage
path: root/vendor/github.com/hashicorp/go-hclog/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/hashicorp/go-hclog/README.md')
-rw-r--r--vendor/github.com/hashicorp/go-hclog/README.md14
1 files changed, 12 insertions, 2 deletions
diff --git a/vendor/github.com/hashicorp/go-hclog/README.md b/vendor/github.com/hashicorp/go-hclog/README.md
index 614342b..1153e28 100644
--- a/vendor/github.com/hashicorp/go-hclog/README.md
+++ b/vendor/github.com/hashicorp/go-hclog/README.md
@@ -10,8 +10,7 @@ interface for use in development and production environments.
10It provides logging levels that provide decreased output based upon the 10It provides logging levels that provide decreased output based upon the
11desired amount of output, unlike the standard library `log` package. 11desired amount of output, unlike the standard library `log` package.
12 12
13It does not provide `Printf` style logging, only key/value logging that is 13It provides `Printf` style logging of values via `hclog.Fmt()`.
14exposed as arguments to the logging functions for simplicity.
15 14
16It provides a human readable output mode for use in development as well as 15It provides a human readable output mode for use in development as well as
17JSON output mode for production. 16JSON output mode for production.
@@ -100,6 +99,17 @@ requestLogger.Info("we are transporting a request")
100This allows sub Loggers to be context specific without having to thread that 99This allows sub Loggers to be context specific without having to thread that
101into all the callers. 100into all the callers.
102 101
102### Using `hclog.Fmt()`
103
104```go
105var int totalBandwidth = 200
106appLogger.Info("total bandwidth exceeded", "bandwidth", hclog.Fmt("%d GB/s", totalBandwidth))
107```
108
109```text
110... [INFO ] my-app: total bandwidth exceeded: bandwidth="200 GB/s"
111```
112
103### Use this with code that uses the standard library logger 113### Use this with code that uses the standard library logger
104 114
105If you want to use the standard library's `log.Logger` interface you can wrap 115If you want to use the standard library's `log.Logger` interface you can wrap