Replies: 1 comment 5 replies
-
I made this as an integration: https://inox-tools.vercel.app/runtime-logger#for-projects You can run |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Body
Summary
Expose Astro's internal logger to global scope so that it can be used in other scripts or components.
Background & Motivation
Had written some custom i18n utilities inside the
src
folder, and want some logging as hint if I'm making some mistake.Goals
The background is a more specific example of the situation where the user want to intentionally keep some logging code in their code base, rather than using
console.log
as a temporary debug print.Also, the output of
console.log
would be (somewhat falsely) cleared by Astro's logger if Astro's logger are logging the same content (the(xN)
mark) whileconsole.log
isn't. I guess there's no easy solution to this issue, and it actually doesn't matter much when using logging as a debug method. but it would be hindering when a constant output is expected.Something like
import { useLogger } from Astro
inside a.js/ts
file orAstro.useLogger
inside an.astro
file would be useful in this situation.Example
Beta Was this translation helpful? Give feedback.
All reactions