diff options
Diffstat (limited to 'vendor/github.com/hashicorp/go-hclog/README.md')
-rw-r--r-- | vendor/github.com/hashicorp/go-hclog/README.md | 14 |
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. | |||
10 | It provides logging levels that provide decreased output based upon the | 10 | It provides logging levels that provide decreased output based upon the |
11 | desired amount of output, unlike the standard library `log` package. | 11 | desired amount of output, unlike the standard library `log` package. |
12 | 12 | ||
13 | It does not provide `Printf` style logging, only key/value logging that is | 13 | It provides `Printf` style logging of values via `hclog.Fmt()`. |
14 | exposed as arguments to the logging functions for simplicity. | ||
15 | 14 | ||
16 | It provides a human readable output mode for use in development as well as | 15 | It provides a human readable output mode for use in development as well as |
17 | JSON output mode for production. | 16 | JSON output mode for production. |
@@ -100,6 +99,17 @@ requestLogger.Info("we are transporting a request") | |||
100 | This allows sub Loggers to be context specific without having to thread that | 99 | This allows sub Loggers to be context specific without having to thread that |
101 | into all the callers. | 100 | into all the callers. |
102 | 101 | ||
102 | ### Using `hclog.Fmt()` | ||
103 | |||
104 | ```go | ||
105 | var int totalBandwidth = 200 | ||
106 | appLogger.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 | ||
105 | If you want to use the standard library's `log.Logger` interface you can wrap | 115 | If you want to use the standard library's `log.Logger` interface you can wrap |