Commit Graph

130 Commits

Author SHA1 Message Date
Anton Tiurin d1dfe8db73 [TextFormatter] Preallocate enough memory for keys to speedup.
Benchmarks:
 * BenchmarkSmallTextFormatter: 6140/5943 ~3%
 * BenchmarkLargeTextFormatter: 28050/24789 ~11%

Signed-off-by: Anton Tiurin <noxiouz@yandex.ru>
2015-02-17 19:08:32 +03:00
Simon Eskildsen 58f778a886 Revert "Merge pull request #100 from crquan/patch-1"
This reverts commit c6a969a0de, reversing
changes made to 3c5b048a9d.
2015-01-15 13:40:48 -05:00
Derek Che dcbe8d66af make sure no leading or trailing spaces
This changed printColored and printKeyValue to print in same way
with prefix space instead of trailing space, to make it easier
to slice out when returning in Format;
The test cases are to make sure msg formartting doesn't include
leading or trailing spaces;

Closes #99

Signed-off-by: Derek Che <drc@yahoo-inc.com>
2015-01-04 00:19:36 -08:00
Derek Che a243bbaa0b share common calling path in printKeyValue
Signed-off-by: Derek Che <drc@yahoo-inc.com>
2015-01-04 00:01:49 -08:00
Derek Che 03377c6168 rename f.appendKeyValue to printKeyValue
printKeyValue is working similar like printColored, not using
any fields of TextFormatter, should be a util func instead of
a method of TextFormatter.

Signed-off-by: Derek Che <drc@yahoo-inc.com>
2015-01-03 23:56:39 -08:00
Simon Eskildsen 51fe59aca1 Merge pull request #92 from rasky/no-extra-quoting
Avoid extra quotes where not strictly necessary.
2014-12-18 10:52:14 -05:00
Giovanni Bajo 15b296befc Avoid using regexp 2014-12-18 15:09:01 +01:00
Simon Eskildsen 7096056d3c Merge pull request #91 from rasky/disable-timestamp
Allow disabling timestamp in non-tty output.
2014-12-15 16:09:30 -05:00
Giovanni Bajo f0a637a834 Document new option 2014-12-15 21:58:26 +01:00
Giovanni Bajo a3ef049df9 Avoid extra quotes where not strictly necessary.
It's not necessary to enclose in quotes every single string value
in log2met format; when using basic words, it's possible to not
quote it (as heroku does for its own logging). This keeps the
logs easier on the human eye.
2014-12-15 20:20:33 +01:00
Giovanni Bajo 3e9d38f80d Allow disabling timestamp in non-tty output.
This is useful if the output is already being piped to a logger
daemon that will prefix the timestamp by itself (eg: on heroku).
2014-12-15 20:02:02 +01:00
Antoine Grondin 2835e150d9 fixes #88 2014-12-09 21:57:50 -05:00
Antoine Grondin acf1c0d583 textformatter: errors should be in quotes like strings are 2014-10-03 11:58:24 -04:00
Antoine Grondin c4cc714937 fix duplication of msg/time/level keys, add benchmarks. 2014-09-16 20:19:42 -04:00
Antoine Grondin d35b1c983e text-formatter: assume that IsTerminal doesn't change during execution 2014-09-16 17:19:03 -04:00
Matt Price e2a44689a6 updated README and added reference 2014-08-13 13:36:59 -04:00
Matt Price af9d545893 can completely disable colors on text formatter 2014-08-13 13:30:25 -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
Aaron L 0d1e231957 Clean up text_formatter code with a byte.Buffer 2014-05-24 07:48:57 -07:00
Simon Eskildsen 13600d2325 text_formatter: move relative time logic from entry 2014-05-03 20:43:55 -04:00
Rob Napier d32bfc962c Add Windows/FreeBSD support 2014-04-23 19:38:56 -04:00
Dan Buch 79b3145302 Switching non-TTY text formatter to use %q instead of '%v'
so that the output becomes l2met compatible yey!
2014-04-20 15:29:03 -04:00
Simon Eskildsen f9af352362 Merge pull request #10 from pushrax/add-forced-colors
Add option to force TextFormatter to use colors
2014-03-16 16:17:15 -07:00
Justin Li 436d68deda Add option to force TextFormatter to use colors 2014-03-15 23:41:05 -04:00
Justin Li c999e7c963 Set color to red for error level output 2014-03-15 23:34:03 -04:00
Simon Eskildsen 0998f68ad5 text_formatter: ensure quoting of strings 2014-03-14 13:32:49 -04:00
Simon Eskildsen 52eb1c0f57 text_formatter: use %v instead 2014-03-14 13:15:01 -04:00
Simon Eskildsen 1000975e52 text_formatter: change to simpler k-v when no tty 2014-03-14 13:01:06 -04:00
Simon Eskildsen 53371e3664 Add features from README 2014-03-10 19:22:08 -04:00