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
Log is a simple,highly configurable, Structured Logging that is a near drop in replacement for the std library log
10
+
Log is a simple,highly configurable, Structured Logging library
11
11
12
12
Why another logging library?
13
13
----------------------------
14
-
There's allot of great stuff out there, but also thought a log library could be made easier to use, more efficient by reusing objects and more performant using channels.
14
+
There's allot of great stuff out there, but also thought a log library could be made more configurable using per handler log levels.
15
15
16
16
Features
17
17
--------
18
18
-[x] Logger is simple, only logic to create the log entry and send it off to the handlers and they take it from there.
19
-
-[x] Sends the log entry to the handlers asynchronously, but waits for all to complete; meaning all your handlers can be dealing with the log entry at the same time, but log will wait until all have completed before moving on.
20
19
-[x] Ability to specify which log levels get sent to each handler
21
-
-[x] Built-in console, syslog, http, HipChat and email handlers
20
+
-[x] Built-in console, syslog, http, HipChat, json and email handlers
22
21
-[x] Handlers are simple to write + easy to register
23
22
-[x] Logger is a singleton ( one of the few instances a singleton is desired ) so the root package registers which handlers are used and any libraries just follow suit.
**DebugLevel** - Info useful to developers for debugging the application, not useful during operations.
167
152
168
-
**TraceLevel** - Info useful to developers for debugging the application and reporting on possible bottlenecks.
169
-
170
153
**InfoLevel** - Normal operational messages - may be harvested for reporting, measuring throughput, etc. - no action required.
171
154
172
155
**NoticeLevel** - Normal but significant condition. Events that are unusual but not error conditions - might be summarized in an email to developers or admins to spot potential problems - no immediate action required.
@@ -185,13 +168,14 @@ Handlers
185
168
-------------
186
169
Pull requests for new handlers are welcome, please provide test coverage is all I ask.
187
170
188
-
| Handler | Description | Docs |
189
-
| ------- | ---- | ----------- |
190
-
| console | Allows for log messages to be sent to a any writer, default os.Stderr |[](https://godoc.org/github.com/go-playground/log/handlers/console)|
191
-
| syslog | Allows for log messages to be sent via syslog, includes TLS support. |[](https://godoc.org/github.com/go-playground/log/handlers/syslog)|
192
-
| http | Allows for log messages to be sent via http. Can use the HTTP handler as a base for creating other handlers requiring http transmission. |[](https://godoc.org/github.com/go-playground/log/handlers/http)|
193
-
| email | Allows for log messages to be sent via email. |[](https://godoc.org/github.com/go-playground/log/handlers/email)|
194
-
| hipchat | Allows for log messages to be sent to a hipchat room. |[](https://godoc.org/github.com/go-playground/log/handlers/http/hipchat)|
| console | Allows for log messages to be sent to a any writer, default os.Stderr |[](https://godoc.org/github.com/go-playground/log/handlers/console)|
174
+
| syslog | Allows for log messages to be sent via syslog, includes TLS support. |[](https://godoc.org/github.com/go-playground/log/handlers/syslog)|
175
+
| http | Allows for log messages to be sent via http. Can use the HTTP handler as a base for creating other handlers requiring http transmission. |[](https://godoc.org/github.com/go-playground/log/handlers/http)|
176
+
| email | Allows for log messages to be sent via email. |[](https://godoc.org/github.com/go-playground/log/handlers/email)|
177
+
| hipchat | Allows for log messages to be sent to a hipchat room. |[](https://godoc.org/github.com/go-playground/log/handlers/http/hipchat)|
178
+
| json | Allows for log messages to be sent to any wrtier in json format. |[](https://godoc.org/github.com/go-playground/log/handlers/json)|
195
179
196
180
Package Versioning
197
181
----------
@@ -204,21 +188,20 @@ things for you the community.
204
188
205
189
Benchmarks
206
190
----------
207
-
###### Run on i5-7600 16 GB DDR4-2400 using Go version go1.8 linux/amd64
191
+
###### Run on Macbook Pro 15-inch 2017 using go version go1.9.4 darwin/amd64
208
192
NOTE: only putting benchmarks at others request, by no means does the number of allocations
0 commit comments