Skip to content

Where is site.logger in Lume 2? #524

Answered by ngdangtu-vn
ngdangtu-vn asked this question in Q&A
Discussion options

You must be logged in to vote

In Lume 1, to print message on console, we tend to use site.logger. This feature has breaking change in Lume 2 with it own utils module lume/core/utils/log.ts.

In Lume 1:

// We need Site object to use logger
site.logger.log('message')
site.logger.warn('warning')

In Lume 2:

// We only have to call it from a utll module
import { log } from 'lume/core/utils/log.ts'

// Come with more flavour
log.info(msg)
log.debug(msg)
log.warning(msg)
log.error(msg)
log.critical(msg)

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ngdangtu-vn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant