Skip to content

Commit

Permalink
Added note in the docs about Windows terminal and unicode (#552)
Browse files Browse the repository at this point in the history
Fixes #548.
  • Loading branch information
mcollina committed Nov 22, 2018
1 parent d65c0d1 commit 3b7019e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions docs/help.md
Expand Up @@ -9,6 +9,7 @@
* [Duplicate keys](#dupe-keys)
* [Log levels as labels instead of numbers](#level-string)
* [Pino with `debug`](#debug)
* [Unicode and Windows terminal](#windows)

<a id="exit-logging"></a>
## Exit logging
Expand Down Expand Up @@ -199,3 +200,16 @@ $ DEBUG=* node -r pino-debug app.js
[`pino-debug`](http://github.com/pinojs/pino-debug) also offers fine grain control to map specific `debug`
namespaces to `pino` log levels. See [`pino-debug`](http://github.com/pinojs/pino-debug)
for more.

<a id="windows"></a>
## Unicode and Windows terminal

Pino uses [sonic-boom](https://github.com/mcollina/sonic-boom) to speed
up logging. Internally, it uses [`fs.write`](https://nodejs.org/dist/latest-v10.x/docs/api/fs.html#fs_fs_write_fd_string_position_encoding_callback) to write log lines directly to a file
descriptor. On Windows, unicode output is not handled properly in the
terminal (both `cmd.exe` and powershell), and as such the output could
be visualized incorrectly if the log lines include utf8 characters. It
is possible to configure the terminal to visualize those characters
correctly with the use of [`chcp`](https://ss64.com/nt/chcp.html) by
executing in the terminal `chcp 65001`. This is a known limitation of
Node.js.

0 comments on commit 3b7019e

Please sign in to comment.