Commit Graph

35 Commits

Author SHA1 Message Date
Ted Lilley 5bdc93f7eb
Fix console formatter for timestampunixnano (#502)
Co-authored-by: Ted Lilley <ted.lilley@digi.com>
2022-11-03 01:35:19 +01:00
Patrick Scheid a9a8199d2d
ConsoleWriter fallbacks to local timezone for missing TZ indicator (#497)
Closes issue #483

Before:
We use time.Parse which defaults to TZ UTC if there is no time zone
indicator specified in the time layout string. During the reparsing in
ConsoleWriter we therefore added the TZ difference to UTC twice.

After:
We use time.ParseInLocal where we need to provide a dedicated fallback
TZ as a fallback. Since we now fallback to the local TZ, we don't add
the TZ difference to UTC twice.
2022-10-21 23:32:46 +02:00
Yuki Furuyama 55aaf043cf
Show original level message if it's not predefined value. (#476) 2022-09-18 16:53:56 +02:00
Mitar 4099072c03
Support extra arbitrary data at the end of console log (#416) 2022-07-18 23:00:50 +01:00
Olivier Poitrey afdf9978ec Revert "remove fields written into "PartsOrder" (#383)"
This reverts commit 2a13872817.
2022-07-16 21:17:58 +01:00
Mitar dbdec88d16
Use everywhere InterfaceMarshalFunc (#414) 2022-07-16 21:03:29 +01:00
Mitar b30730fab2
Show local time in console (#415) 2022-07-16 21:02:45 +01:00
Adam Horacek 2a13872817
remove fields written into "PartsOrder" (#383) 2022-06-29 01:36:09 +02:00
Chelsea Hoover 263b0bde36
#411 Add FieldsExclude parameter to console writer (#418) 2022-02-27 18:33:36 +01:00
Mitar 361cdf616a
Remove extra space in console when there is no message (#413) 2022-02-19 16:39:18 +01:00
nichady 665519c4da
Fix ConsoleWriter color on Windows (#390)
* fix ConsoleWriter colors on windows
* fix ConsoleWriter color when created with struct literal
2021-12-19 23:50:53 +01:00
Asger Noer 0d2f0be4ee
fix: error field name color (#377) 2021-11-09 12:34:43 +01:00
adw1n 0872592ea2
Make default console formatter work with customized level names (#330) 2021-07-15 22:04:15 +02:00
Jason McVetta b7e31f4fe7
Log relative path for caller when using `ConsoleWriter` (#267)
* use relative file path
2020-12-28 22:38:24 +01:00
CrazyMax 29d8dac5e8
Allow to exclude parts from console output (#272)
Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com>
2020-11-29 10:13:56 +01:00
Jason McVetta cac3894be4
don't trim leading slash on callers outside cwd (#266)
Fixes https://github.com/rs/zerolog/issues/265
2020-11-02 13:52:51 +01:00
wphan d2a97b366b fix ConsoleWriter for TimeFormatMicro (#206) 2019-12-20 09:34:21 -08:00
CrazyMax 4502cc1942 Add TraceLevel (#158) 2019-11-04 11:39:22 -08:00
Olivier Poitrey acf3980132 console: handle timestamp in ms correctly + fix UTC 2019-04-25 12:44:49 -07:00
Olivier Poitrey 33f552ec3d Fix console write with missing level field 2019-04-25 12:12:24 -07:00
Olivier Poitrey 2a07580c27 Fix console writer when unix time stamp and/or no message field is used 2019-04-25 12:01:27 -07:00
Kevin McConnell 4daee2b758 Don't use faint text in colorized console output (#131)
The faint text style doesn't seem to be supported by all terminals,
which means the default console output loses most of its coloring on
them.

This commit changes the color scheme to more widely-supported colors.
This also matches how it looked in earlier versions of this library.
2019-02-07 07:45:02 -08:00
Ingmar Stein c482b20623 ConsoleWriter: fix race condition (#120)
Alternative approach to #118: fix the race condition by replacing the package-level customization settings with curried functions.
2018-12-07 09:59:01 -08:00
Ingmar Stein 7179aeef58 ConsoleWriter: reset buffer before returning it to the pool (#119)
The buffers put back into the pool should be equivalent to those generated by the `New` function.
2018-12-05 07:46:12 +00:00
Yongzheng Lai 7bcaa1a99e fix: console ts with json number (#115) 2018-11-12 00:50:17 -08:00
Karel Minarik a4c54e5d8b Fix the ConsoleWriter default parts order (#113)
In order to prevent incorrect output when somebody uses a different name eg. for the "MessageFieldName",
the `consoleDefaultPartsOrder` variable has been switched to a function, which is called in `Write()`,
in order to pick up the custom name.

Related: rs/zerolog#92
2018-11-07 09:39:38 -08:00
Karel Minarik 96f91bb4f5 Refactored zerolog.ConsoleWriter to allow customization (#92)
* Added a simple benchmarking test for the ConsoleWriter
* Refactored `zerolog.ConsoleWriter` to allow customization

Closes #84
2018-11-05 02:15:13 -08:00
Dave McCormick bae001d86b Allow devs to change the width of the logging level column in consolewriter (#87)
* Allow user to change the width of the logging level column
* Change default level width to 0 (no dynamic width)
2018-07-25 10:05:55 -07:00
Olivier Poitrey c62533f761 Fix ConsoleWriter test 2018-05-17 16:35:57 -07:00
Olivier Poitrey fb469685aa Fix ConsoleWriter when zerolog is configured to use UNIX timestamp 2018-05-17 16:10:49 -07:00
Olivier Poitrey d2b7a51951 Do not print large ints using scientific notation with ConsoleWriter
Fixes #55
2018-04-19 13:13:40 -07:00
Ravi Raju ddfae1b613 Binary format support (#37)
Adds support for binary logging (with cbor encoding) in addition to JSON. Use the binary_log compile tag to enable the feature.
2018-03-28 11:49:41 -07:00
Olivier Poitrey a717e7cbed Improve ConsoleWriter of non-scalar types 2018-02-13 00:20:42 -08:00
Olivier Poitrey 2ed2f2c974 Fix pretty logging and add a screenshot to the README 2017-08-05 20:45:41 -07:00
Olivier Poitrey 90fdb63d84 Add missing console file 2017-08-05 19:59:04 -07:00