Commit Graph

21 Commits

Author SHA1 Message Date
David Bariod d2654b752f add file and line number in output when report caller is enabled 2018-10-28 17:39:39 +01:00
David Bariod 64d5b7e66c Merge branch 'master' into caller_feature 2018-10-27 15:10:52 +02:00
David Bariod 7b467df697 Skip func type value in fields.
We skip those unprintable fields and an error field
instead of dropping the whole trace.

Fixes #642
2018-09-30 22:51:02 +02:00
Neil Isaac 5d60369ef3 Fixed prefixFieldClashes for TextFormatter and added coverage 2018-06-18 21:32:35 -04:00
Lyra Naeseth efab7f37b7 Have prefixFieldClashes respect the JSON FieldMap
Currently, it will fix clashes that don't exist and miss clashes that
do exist due to field remapping.

Fixes #708
2018-02-13 17:49:16 -08:00
Dave Clendenan 3cb9e18ef9 test updates
- add tests for callers accessed directly or via function pointer
  (results are unchanged)
- undo unwanted capitalization/export in previous commit
2017-08-02 17:21:18 -07:00
Dave Clendenan 7d48cb786e Merge branch 'master' of https://github.com/sirupsen/logrus
Conflicts:
	alt_exit_test.go
	formatter.go
	json_formatter.go
2017-08-02 13:18:39 -07:00
dmathieu 325575f181 fix golint issues in formatters 2017-07-26 14:26:30 +02:00
Dave Clendenan 88dd8df1f8 responses to code review
- field rename to be more properly generic
 - drop rewrite of main.main
2016-12-06 12:53:21 -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
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 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
Olivier Mengué 12ea3a4f8e formatter.go: simplify prefixFieldClashes(Fields) 2015-11-21 17:51:52 +01:00
Stephen J Day e14471f8f2 Allow configuration of timestamp layout
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2015-04-06 12:18:40 -07:00
Antoine Grondin 2835e150d9 fixes #88 2014-12-09 21:57:50 -05:00
Markus Zimmermann 5573f97efc fix some typos 2014-10-16 14:43:18 +02:00
Antoine Grondin c4cc714937 fix duplication of msg/time/level keys, add benchmarks. 2014-09-16 20:19:42 -04:00
Simon Eskildsen 2c0db7c868 formatter: drop internalFormatter 2014-07-26 22:22:39 -04:00
Simon Eskildsen 40069a98d6 entry: break out time, level and message from data 2014-07-26 21:34:29 -04:00
Simon Eskildsen d02c5b387e docs: add documentation for godoc 2014-03-12 10:34:29 -04:00
Simon Eskildsen 53371e3664 Add features from README 2014-03-10 19:22:08 -04:00