You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While trying out the new runtime logger, i'm seeing a couple of things I wanted to ask about.
When importing into a page /src/pages/index.astro
import { logger } from '@it-astro:logger'
I get the following error in VS Code:
Cannot find module '@it-astro:logger' or its corresponding type declarations.ts(2307)
I can use the logger functions (logger.info, etc...) but that error is bothersome.
=====
All of the logger functions seem to work, BUT the logger.debug statements are only visible when running astro dev --verbose. Seems odd.
I've tried to use logger.options to set a different default level, but that didn't work either.
It would be great to get the debug logs working without the very very verbose --verbose option.
=====
Bonus:
It looks like we can even use the fork command to create a custom logger (Great!), but when doing so, it loses the source of the event in the emitted log. It would be great if that was on the roadmap as well as adding the logger.table function, which I think is highly underutilized.
The text was updated successfully, but these errors were encountered:
When importing into a page /src/pages/index.astro
import { logger } from '@it-astro:logger'
I get the following error in VS Code: Cannot find module '@it-astro:logger' or its corresponding type declarations.ts(2307)
I can use the logger functions (logger.info, etc...) but that error is bothersome.
That is strange. I just tried VSCode on a plain, simple project (using the minimal template) and got the types correctly. I use NeoVim and it is also working fine, but that is expected since both use the same language server.
Running astro check also validates the types correctly, as shown on here.
Can you share your tsconfig.json file and your astro.config.mjs?
Which version of Astro are you using?
All of the logger functions seem to work, BUT the logger.debug statements are only visible when running astro dev --verbose. Seems odd.
I've tried to use logger.options to set a different default level, but that didn't work either. It would be great to get the debug logs working without the very very verbose --verbose option.
That is as intended. The library aims to expose Astro's AstroIntegrationLogger at runtime. It behaves the same as the logger on the integrations, so behavior is just coming from Astro itself.
You can open a discussion on Astro's roadmap repo with a proposal of alternative behaviors.
Bonus:
It looks like we can even use the fork command to create a custom logger (Great!), but when doing so, it loses the source of the event in the emitted log.
I don't understand what you mean by "loses the source of the event". Can you elaborate on that?
It would be great if that was on the roadmap as well as adding the logger.table function, which I think is highly underutilized.
As mentioned above, the lib is not intended to deviate from Astro's logger. You can propose this on Astro itself 😄
While trying out the new runtime logger, i'm seeing a couple of things I wanted to ask about.
import { logger } from '@it-astro:logger'
I get the following error in VS Code:
Cannot find module '@it-astro:logger' or its corresponding type declarations.ts(2307)
I can use the logger functions (logger.info, etc...) but that error is bothersome.
=====
I've tried to use logger.options to set a different default level, but that didn't work either.
It would be great to get the debug logs working without the very very verbose --verbose option.
=====
It looks like we can even use the fork command to create a custom logger (Great!), but when doing so, it loses the source of the event in the emitted log. It would be great if that was on the roadmap as well as adding the logger.table function, which I think is highly underutilized.
The text was updated successfully, but these errors were encountered: