Skip to content

message is always undefined #406

Description

@luuktap

Environment

Running Ubuntu in WSL
Tested with consola@3.4.2 on Node 24.12.0 (LTS) and Bun 1.3.5.

Reproduction

import { createConsola } from 'consola';

const logger = createConsola({
  reporters: [
    {
      log: (logObj, ctx) => {
        console.log('message', logObj.message);
        console.log('args', logObj.args);
        console.log('additional', logObj.additional);
      },
    },
  ],
});

logger.info('Test Message');

logger.info('Test Message with args', { arg1: 'value1', arg2: 42 });

Describe the bug

In the custom reporter, logObj.message is always undefined. I'm expecting the first parameter passed into logger.info here.

Additional context

No response

Logs

node log-test.ts
message undefined
args [ 'Test Message' ]
additional undefined
message undefined
args [ 'Test Message with args', { arg1: 'value1', arg2: 42 } ]
additional undefined



bun run log-test
message undefined
args [ "Test Message" ]
additional undefined
message undefined
args [ "Test Message with args", {
    arg1: "value1",
    arg2: 42,
  } ]
additional undefined

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions