In my Node/NuxtJS stack, I use a standardized log structure which is:
{
time: '2022-02-11T15:00:29.897Z',
level: 'DEBUG',
message: 'something',
}
I would like to be able to control which logs I see based on an environment variable I pass to the npm script, e.g. :
dev: LOGLEVEL=debug node --inspect node_modules/.bin/nuxt
would only show logs with level: 'DEBUG'.
What do I need to do to achieve the above?
I also have the possibility to use consola to wrap logs if necessary.