Replies: 2 comments
-
What makes Nitro so powerful is that on one hand it is very flexible but on the other there is already the huge UnJS ecosystem. Therefor this feature request can already be solved by adding a simple example to the docs how to create a logger, e.g.:
import { createConsola } from 'consola';
import type { ConsolaInstance } from 'consola/core';
let consola: ConsolaInstance;
export const useLogger = () => {
if (!consola) {
const { logLevel } = useRuntimeConfig();
consola = createConsola({
level: logLevel,
});
}
return consola;
}; |
Beta Was this translation helpful? Give feedback.
0 replies
-
Having |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Every "big" framework provide a logger (e.g. NestJS and AdonisJS.
To me personally I would be happy to be able to log to console, e.g. with consola, but I know a lot of people also need to log to files, or maybe use external logging services.
Needed features
const logger = useLogger('checkout')
and then the context is always prefixedBeta Was this translation helpful? Give feedback.
All reactions