Commit Graph

126 Commits

Author SHA1 Message Date
Thomas Lacroix c7455de10a Adds flag to disable quotes in TextFormatter 2020-04-23 14:02:38 +02:00
Mark Phelps 53000c4c0f
Merge pull request #921 from sosiska/patch-1
Rewrite if-else-if-else to switch statements
2020-03-04 09:42:50 -05:00
Edward Muller 007cacdd34
Force Quote
Closed #1005
2019-10-14 22:53:51 -07:00
Lynn Cyrin af6ed964ef len => RuneCount
note: this is not currently easily testable without a larger diff that refactors the levels
2019-06-26 20:48:04 -07:00
Lynn Cyrin 693469de8f dynamically space the level text 2019-06-24 20:42:20 -07:00
Lynn Cyrin fa0d2a82ff
add implementation and tests 2019-06-05 00:10:46 -07:00
David Bariod 744fc4caad fix build break for plan9 2019-05-18 11:44:18 +02:00
Haoran Xu 6c615e1abe remove field if val is empty string for func and file field in text formatter 2019-04-02 11:43:56 +08:00
Kirill Motkov 1487633cc3 Rewrite if-else-if-else to switch statements 2019-03-13 12:38:09 +03:00
David Bariod ffec2f2e0a Add a CallerPrettyfier callback to the text formatter 2019-02-27 13:35:45 +01:00
Sergey Romanov 78fb3852d9 Remove unused variables in TextFormatter 2019-01-11 11:22:21 -08:00
David Bariod 9f049671f1
Merge pull request #864 from ceriath/patch-1
Remove colored output on windows
2018-12-10 09:02:29 +01:00
Ceriath d962013756 respect ForceColor and environment variables over OS check 2018-12-09 21:47:44 +01:00
ceriath e9026580bf
Disable colored output on windows entirely
Currently the textformatter on windows outputs 

``←[31mERRO←[0m[0000] test windows``

when coloring is not disabled explicitly.
However, windows up to windows 8.1 does not support colored output on cmd entirely. Windows 10 added support for it, which is off by default and has to be enabled via registry or environment variable. Therefore i suggest removing colored output on windows entirely to make the output usable again.
2018-11-16 15:17:01 +01:00
Hǎi-Liàng "Hal" Wáng c7183bf629 fix missing parameter 2018-11-06 10:01:28 +00:00
Hǎi-Liàng "Hal" Wáng 2cafb78db2 fix race condition caused by writing to entry.Data, using the same technique as JSONFormatter 2018-11-05 12:35:02 +00:00
David Bariod d10c2f9e3c fix panic in text formatter
The panic was caused to a nil pointer access when report
caller was activated with output coloring disabled

Fixes #852
2018-10-31 07:08:09 +01:00
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 ec57031db1 store a runtime.Frame in Entry instead of the caller function name 2018-10-28 14:21:49 +01:00
David Bariod 64d5b7e66c Merge branch 'master' into caller_feature 2018-10-27 15:10:52 +02:00
drampull 4981d8161c Added TRACE level logging. 2018-10-17 18:22:00 -07: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
David Bariod 73bc94e60c Add custom sorting function in text formatter 2018-09-25 13:45:23 +02:00
David Bariod c38641a38d Merge branch 'win10-color-support' of git://github.com/konsorten/logrus into konsorten-win10-color-support 2018-09-16 09:12:22 +02:00
David Bariod 0908e58e06
Merge pull request #685 from HectorMalot/master
TextFormatter behaviour aligned with stdlib log (fixes #167)
2018-08-26 11:06:30 +02:00
David Bariod eb968b6506 Fix for CLICOLOR_FORCE handling 2018-08-09 15:00:46 +02:00
Dennis f9ef1703ff
Merge branch 'master' into master 2018-08-05 22:34:28 +02:00
Alessio Caiazza 37d651c1f2 Add CLICOLOR support
This implement CLICOLOR and CLICOLOR_FORCE check on terminal coloring
as defined in https://bixense.com/clicolors/
2018-08-01 17:37:01 +02:00
Neil Isaac 5d60369ef3 Fixed prefixFieldClashes for TextFormatter and added coverage 2018-06-18 21:32:35 -04:00
Neil Isaac 21326f6618 Merge remote-tracking branch 'origin/master' into text-field-map 2018-06-18 21:08:59 -04:00
Felix Kollmann 2f58bc83cb Unified terminal initialization code handling 2018-04-03 04:55:52 +02:00
Felix Kollmann 9bc59a5969 Fixed initTerminal() was run for non-terminals 2018-04-03 04:50:50 +02:00
Felix Kollmann bb487e068c Added support for text coloring on Windows 10 2018-04-03 00:25:30 +02:00
Stephen Day 778f2e774c
Merge pull request #407 from roganartu/master
Added option to disable level text truncation in default text formatter
2018-03-29 15:59:52 -07:00
Dave Clendenan c74e39f432
Merge branch 'master' into master 2018-03-08 15:53:25 -08: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
Tony Lee 269eab0f22
Merge branch 'master' into master 2018-01-23 23:04:29 -05:00
Dennis de Reus 92aece568b TextFormatter behaviour aligned with stdlib log (fixes #167)
stdlib `log` adds a newline at the end of a message if none is present,
otherwise does not. Before this change logrus would always add
a newline, resulting in inconsistent behaviour if stdlib log was
replaced with logrus, and a user would e.g. use 'log.printf("test\n")'
2017-12-29 20:26:35 +01:00
Neil Isaac b9eceae8f6
fix example 2017-11-21 22:56:37 -05:00
Neil Isaac bf1fb70b2b Add FieldMap support to TestFormatter 2017-11-21 22:43:47 -05:00
Ernesto Alejo 7d3ddc68a3 Split terminal check to add build tags to support App Engine. 2017-09-06 19:34:58 +02: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 e66f22976f remove os-specific IsTerminal methods, and use x/crypto/ssh/terminal instead 2017-07-27 15:26:52 +02:00
dmathieu 325575f181 fix golint issues in formatters 2017-07-26 14:26:30 +02:00
dmathieu 211aba39c8 use buffer length to avoid generating strings every time 2017-07-25 09:39:35 +02:00
dmathieu 159e991025 only add a space between text entries if there is already content
So we don't have a trailing space at the end of each log line
2017-07-21 16:14:28 +02:00
dmathieu 2727ac94b0 remove QuoteCharacter option
This seems to be one of the most reported issues, as it makes it a lot
harder to safely escape strings.

This option is very much an edge case, and it's causing too much issues
compared to what it provide.
2017-07-13 13:46:35 +02:00
Paul Seiffert b019ab48c5
Error is not a special case anymore 2017-07-12 17:54:01 +02:00
Paul Seiffert 4c4851c96a
Reduce duplicate code 2017-07-12 17:16:13 +02:00
Paul Seiffert b9cfd82645
Quote non-string values if necessary 2017-07-12 17:15:13 +02:00