unjs / consola

🐨 Elegant Console Logger for Node.js and Browser
Other
6k stars 175 forks source link

General purpose log method #165

Closed tobiasdiez closed 1 year ago

tobiasdiez commented 1 year ago

Describe the feature

Add a new method that accepts the message and the log level as arguments.

Additional information

ineshbose commented 1 year ago

I have a similar implementation in one of my projects:

import consola, { type logType } from 'consola'

export const useConsola = (
  type: Exclude<logType, 'silent' | 'verbose'>,
  message: any,
  ...args: any[]
) => consola[type](message, ...args)