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

feat(logger): timestamp, pretty-print objects #337

Merged
merged 1 commit into from
Mar 20, 2024
Merged

feat(logger): timestamp, pretty-print objects #337

merged 1 commit into from
Mar 20, 2024

Conversation

justinmk
Copy link
Member

BEFORE:

info: [object Object]
debug: request -> nvim_command
debug: request -> nvim_list_wins
debug: response -> nvim_command: null
debug: response -> nvim_list_wins: [object Object],[object Object],[object Object],[object Object]
...

AFTER:

2024-03-20 11:37:25 INF {
  matches: [
    {
      nvimVersion: '0.10.0-dev-2657+g9765efb40f57',
      path: '/usr/local/bin/nvim',
      buildType: 'RelWithDebInfo',
      luaJitVersion: '2.1.1710088188'
    }
  ],
  invalid: []
}
2024-03-20 11:37:25 DBG request  -> nvim_command
2024-03-20 11:37:25 DBG request  -> nvim_list_wins
2024-03-20 11:37:25 DBG response -> nvim_command: null
2024-03-20 11:37:25 DBG response -> nvim_list_wins: [
  {
    _events: [Object: null prototype] {},
    _eventsCount: 0,
    _maxListeners: undefined,
    transport: '[Object]',
    data: 1003,
    logger: '[Object]',
    client: '[Object]',
    prefix: 'nvim_win_'
  },
  {
    _events: [Object: null prototype] {},
    _eventsCount: 0,
    _maxListeners: undefined,
    transport: '[Object]',
    data: 1002,
    logger: '[Object]',
    client: '[Object]',
    prefix: 'nvim_win_'
  },
  ...
]
...
2024-03-20 11:37:25 DBG request  -> nvim_buf_get_lines
2024-03-20 11:37:25 DBG response -> nvim_buf_get_lines: [ 'line1', 'line2' ]

BEFORE:

    info: [object Object]
    debug: request -> nvim_command
    debug: request -> nvim_list_wins
    debug: response -> nvim_command: null
    debug: response -> nvim_list_wins: [object Object],[object Object],[object Object],[object Object]
    ...

AFTER:

    2024-03-20 11:37:25 INF {
      matches: [
        {
          nvimVersion: '0.10.0-dev-2657+g9765efb40f57',
          path: '/usr/local/bin/nvim',
          buildType: 'RelWithDebInfo',
          luaJitVersion: '2.1.1710088188'
        }
      ],
      invalid: []
    }
    2024-03-20 11:37:25 DBG request  -> nvim_command
    2024-03-20 11:37:25 DBG request  -> nvim_list_wins
    2024-03-20 11:37:25 DBG response -> nvim_command: null
    2024-03-20 11:37:25 DBG response -> nvim_list_wins: [
      {
        _events: [Object: null prototype] {},
        _eventsCount: 0,
        _maxListeners: undefined,
        transport: '[Object]',
        data: 1003,
        logger: '[Object]',
        client: '[Object]',
        prefix: 'nvim_win_'
      },
      {
        _events: [Object: null prototype] {},
        _eventsCount: 0,
        _maxListeners: undefined,
        transport: '[Object]',
        data: 1002,
        logger: '[Object]',
        client: '[Object]',
        prefix: 'nvim_win_'
      },
      ...
    ]
    ...
    2024-03-20 11:37:25 DBG request  -> nvim_buf_get_lines
    2024-03-20 11:37:25 DBG response -> nvim_buf_get_lines: [ 'line1', 'line2' ]
@justinmk justinmk merged commit a2bff3b into master Mar 20, 2024
8 of 9 checks passed
@justinmk justinmk deleted the logobject branch March 20, 2024 11:29
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

Successfully merging this pull request may close these issues.

1 participant