Commit Graph

115 Commits

Author SHA1 Message Date
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
Damien Mathieu 6f87387fae Merge pull request #563 from meatballhat/unquote-more-chars
Allow more chars in unquoted text formatter output
2017-07-12 13:55:30 +02:00
Damien Mathieu 398dd088c2 Merge pull request #399 from pkieltyka/master
TextFormatter: brighten up the blue
2017-07-12 13:42:20 +02:00
Paul Seiffert 0025402362
Extract quoting into separate method 2017-07-10 14:18:45 +02:00
Paul Seiffert 0383f49850
Use custom quote char and escape it 2017-07-10 14:09:37 +02:00
kpcyrd f78f8d07f6
Safely format data when printing
Fixes #531
2017-07-10 13:12:47 +02:00
Dan Buch 5d67428857
Allow more chars in unquoted text formatter output 2017-06-18 09:48:52 -04:00
Ben Brooks e98cd92ccf
Address PR comments 2017-02-15 13:08:26 +00:00
Ben Brooks b545aee819
Add TextFormatter config for custom quote runes 2017-02-14 11:51:23 +00:00
Ben Brooks cfca98e6d9
Add 'QuoteEmptyFields' option to TextFormatter 2017-02-14 10:53:03 +00:00
Dave Clendenan 4b900796a4 Merge branch 'master' of https://github.com/sirupsen/logrus
Conflicts:
	CHANGELOG.md
2017-02-10 07:38:59 -08:00
Simon Eskildsen 11fbf0fa42 text_formatter: fix race 2017-02-06 19:16:49 -05:00