Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emojis don't render properly on all terminals #143

Open
bennycode opened this issue Mar 13, 2018 · 5 comments
Open

Emojis don't render properly on all terminals #143

bennycode opened this issue Mar 13, 2018 · 5 comments

Comments

@bennycode
Copy link
Collaborator

Emojis cannot be rendered on every terminal. This causes the issue that log messages will look strange and don't have a common alignment.

You can see the issue by running my demo code in different terminals:

NODE_DEBUG=* node index.js

const logdown = require('logdown')
const logger = logdown('MyLogger')

logger.debug('Type "debug"')
logger.error('Type "error"')
logger.info('Type "info"')
logger.log('Type "log"')
logger.warn('Type "warn"')

Because the output isn't consistent across platforms, we should replace emojis with standard ASCII symbols (which can be rendered on most of the systems).

I also noticed that logger.debug is not printed on the console. How can I get debug messages? I already used NODE_DEBUG=*.

Command-line interface (Windows)

cmd

PowerShell (Windows)

powershell

Ubuntu Bash (Linux Subsystem on Windows 10)

ubuntu-bash

@bennycode
Copy link
Collaborator Author

Another good solution would be to make the emojis configurable, so that the end user can decide if they should be printed to the console or not.

Proposal:

var logger = logdown({ icons: false })

WDYT @SleepWalker & @caiogondim ?

@SleepWalker
Copy link
Collaborator

SleepWalker commented Mar 18, 2018 via email

@caiogondim
Copy link
Owner

What would be better?
Completely disabling the icons or configuring them individually?
Or maybe both?

const logger1 = logdown({ icons: false })
const logger2 = logdown({ icons: {
  warning: '!',
  error: '!!'
} })

What do you think?

@bennycode
Copy link
Collaborator Author

The easiest to implement (and already useful) config would be turning it on or off completely.

@caiogondim
Copy link
Owner

I'm cool with that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants