Commit Graph

1081 Commits

Author SHA1 Message Date
Dave Clendenan d8fd23467c add syntax hilighting to new example blocks 2016-12-02 10:09:30 -08:00
Dave Clendenan 2e7c40ede0 README formatting tweak 2016-12-02 09:57:30 -08:00
Dave Clendenan 802fba19a4 add note on caller-reporting overhead to README 2016-12-02 09:52:11 -08:00
Dave Clendenan 5840194571 Merge branch 'master' of https://github.com/Sirupsen/logrus
Conflicts:
	alt_exit_test.go
	json_formatter_test.go
2016-12-02 09:38:12 -08:00
Stephen Day 881bee4e20 Merge pull request #446 from AndrewBurian/json-disable-timestamp
Json disable timestamp
2016-12-01 18:35:07 -08:00
Craig Jellick 7d228b51ce Update readme example for switching output
Clarifies that stderr is the default, not stdout.
2016-12-01 17:37:34 -07:00
Simon Eskildsen 3c3917e625 readme: apologize for casing issue 2016-12-01 18:55:03 -05:00
Simon Eskildsen 26809363aa Revert "Merge pull request #384 from mnzt/master"
This reverts commit 42b84f9ec6, reversing
changes made to cf60a8c5d5.
2016-12-01 18:53:16 -05:00
Dave Clendenan 306956c385 tweak timing tests to handle slower VMs and older GoLang 2016-12-01 11:12:44 -08:00
Dave Clendenan f08011a10f merge upstream, add tests, full method context
- added benchmarks, and assertions for timeliness
- replaced regex usage in package-name handling with a straight
  comparison to a cached value
- log the fullly-qualified method name, to remove ambiguity
    eg: github.com/fflintstone/yabba.dabba.doo
- clean up possibly-unsafe assumptions about using the standard logger,
  remove global lookup function to enforce safe usage
2016-12-01 10:23:00 -08:00
Dave Clendenan 65f3af38f7 simplify hasCaller check 2016-11-30 15:15:38 -08:00
Dave Clendenan a5c845c224 responses to review comments
- empty string as marker for failure to discover calling function
 - tighten up logger usage - don't rely on std logger internally

Also fix ordering of expected/got in logrus_test.go to ensure correct
output form test failures.
2016-11-30 14:07:10 -08:00
Simon Eskildsen 42b84f9ec6 Merge pull request #384 from mnzt/master
Renaming upper-case 'Sirupsen' to 'sirupsen'
2016-11-30 15:35:45 -05:00
Stephen Day cf60a8c5d5 Merge pull request #449 from danielgtaylor-isp/patch-1
Fix typo in README
2016-11-30 12:16:55 -08:00
Dave Clendenan 4575b7a64d revert slight added complexity in NewEntry() 2016-11-30 11:36:48 -08:00
Dave Clendenan 05a8f4db95 fix test description 2016-11-30 10:47:03 -08:00
Daniel Taylor 90915c9326 Fix typo in README 2016-11-29 10:52:28 -08:00
Dave Clendenan 962ceebd51 Merge branch 'master' of https://github.com/Sirupsen/logrus 2016-11-29 09:46:00 -08:00
Dave Clendenan 348bace269 doc updates, and relabel ReportMethod
in the Logrus context it's the caller, so use that internally.  Label
stays as 'method' since in the context of the log event that seems more
correct.
2016-11-29 09:35:34 -08:00
Dave Clendenan 1e21450408 push compilation even higher, to reduce to one call 2016-11-28 16:22:33 -08:00
Stephen Day e400ff7861 Merge pull request #447 from stevvooe/revert-example-compilation
Compile examples filtered in #439
2016-11-28 14:57:24 -08:00
Dave Clendenan 8161d932a1 performance: precompile regex before iterating 2016-11-28 14:47:38 -08:00
Dave Clendenan 473c3448ab Add README notes and CHANGELOG entries
documentation for usage of the new optional calling-method logging
2016-11-28 13:43:38 -08:00
Dave Clendenan 93af604ba7 First cut at adding calling method
If log.SetReportMethod(true) then method=PACKAGE.FUNCTION will be added
as a field to log lines.
eg: time="2016-11-25T19:04:43-08:00" level=info method=main msg="log
testing"

TODO: documentation, examples
2016-11-25 19:02:56 -08:00
Stephen J Day 6ecd392994
travis: build Go 1.7 as well, removed by revert
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2016-11-23 16:20:51 -08:00
Stephen J Day a89950b151 Revert "Updated .travis.yml to ignore /examples/"
This reverts commit 140886f9dc.
2016-11-23 16:19:58 -08:00
Andrew Burian c92f90003f Switched hardcoded string for const value 2016-11-21 10:16:24 -08:00
Andrew Burian 1d329ad042 Added option to disable JSON timestamp
Tests verify both the default and disabled case.
2016-11-21 10:09:59 -08:00
Stephen Day a437dfd246 Merge pull request #396 from onetwopunch/customzable-json-keys
Added customizable keys to JSON formatter
2016-11-18 11:45:39 -08:00
Ryan Canty fcf4b8f229
Added comment documentation for FieldMap 2016-11-18 11:02:11 -08:00
Ryan Canty d5ca23f998
Added FieldMap to reduce potential struct bloat 2016-11-17 15:16:46 -08:00
Ryan Canty b2c6f8aa8b Added resolve method to clean up Format 2016-11-17 11:28:41 -08:00
Ryan Canty 2173899f8f Added customizable keys to JSON formatter 2016-11-16 21:56:00 -08:00
Simon Eskildsen abc6f20dab Merge pull request #440 from gemnasium/add-pglogrus
Add pglogrus to README
2016-11-11 07:09:51 -05:00
Simon Eskildsen 528e33852c Remove legacy go versions 2016-11-11 07:09:38 -05:00
Simon Eskildsen 1445b7a382 Merge pull request #439 from irfansharif/pre-go1.6-builds
Updated .travis.yml to ignore /examples/
2016-11-08 14:08:11 -05:00
Philippe Lafoucrière 65aed8c493 Add pglogrus to README 2016-11-03 21:59:20 -04:00
Simon Eskildsen d264929707 Merge pull request #419 from aaronlehmann/fix-error-formatting
Fix formatting of wrapped errors when colors are used
2016-11-03 17:40:07 -04:00
irfan sharif 140886f9dc
Updated .travis.yml to ignore /examples/
/examples/hook/hook.go with it's child dependency on airbrake/gobrake is
not backwards compatible pre-go1.6 due to use of the following:
  - os.LookupEnv (introduced in go1.5)
  - http.StatusTooManyRequests (introduced in go1.6)
ignoring the fetch and explicit test of /examples/ fixes failing go1.3,
go1.4, go1.5 builds.
2016-11-03 01:28:25 -04:00
Simon Eskildsen 380f64d344 Merge pull request #412 from sagar8192/add-scribe-hook-description
Add scribe hook
2016-10-31 10:45:02 -04:00
Simon Eskildsen 8de4982a7a Merge pull request #413 from toorop/master
Add Pushover Hook
2016-10-31 10:44:55 -04:00
Simon Eskildsen 7371813290 Merge pull request #421 from heralight/master
Update README.md
2016-10-31 10:44:43 -04:00
Simon Eskildsen 551ec64450 Merge pull request #422 from JJ/master
Adds new logz.io hook by @ripcurld00d
2016-10-31 10:44:29 -04:00
JJ Merelo ea5eab4f4b Adds new logz.io hook by @ripcurld00d 2016-10-09 13:02:24 +02:00
Alexandre Richonnier 0c8a99c9b8 Update README.md
add link to Logrus and Viper integration Helper
2016-10-05 09:20:26 +02:00
Aaron Lehmann f76d643702 Fix formatting of wrapped errors when colors are used
There are two different code paths for rendering a key/value pair. The
non-color version uses a type switch that handles specific types such as
"error", and the color version uses the %+v printf format specifier.
This causes an inconsistency between the two formats. In particular,
errors created using the github.com/pkg/errors package will include a
stack trace of where the error was created when printed to the terminal,
but not to a file. Printing the stack trace as part of the log field is
probably not the right behavior.

The output is also inconsistent between the two forms because strings
are not quoted/escaped when colors are used. This can make log output
unparseable.

Fix this by making both code paths use the type switch and escaping
rules. Fix the escaping code to pass the error value to Fprintf, not the
error itself, which seems to be necessary to avoid blank output with
errors created by github.com/pkg/errors.
2016-09-28 13:48:28 +01:00
Stéphane Depierrepont aka Toorop f7be9f0695 Add Pushover Hook 2016-09-19 16:09:08 +02:00
Sagar Sadashiv Patwardhan 32472f55b6 Add scribe hook 2016-09-18 12:42:16 -07:00
Tony Lee e5b6713580 Added testing for DisableLevelTruncation 2016-09-01 00:28:23 +10:00
Tony Lee 7a1f601cfd Added ability to disable level text truncation. Fixes #406 2016-08-31 23:55:04 +10:00