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

Logger.table() syntax limits adding columns #1

Open
skybird23333 opened this issue Jan 30, 2022 · 2 comments
Open

Logger.table() syntax limits adding columns #1

skybird23333 opened this issue Jan 30, 2022 · 2 comments

Comments

@skybird23333
Copy link

The current syntax for logging a table with an object is:

logger.table({
  'heading': 'heading',
  'content1': 'content1',
  'content2': 'content2'
})

Which produces the following:

      +---------------------+
      | heading  | heading  |
      +---------------------+
      | content1 | content1 |
      +---------------------+
      | content2 | content2 |
      +---------------------+

This becomes an issue when multple headings need to be used. It uses the first key and the first value as the 2 column headers, and no other columns can be added. The syntax should be changed to something like this, or any other syntax that can support adding columns:

logger.table({
    'heading': ['content1', 'content2'],
    'heading2': ['content1', 'content2']
})
@wait-what
Copy link
Owner

Cool issue

@skybird23333
Copy link
Author

Table frame size is also incorrect when using ANSI escape code in the content.

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

2 participants