1 KiB
1 KiB
title |
---|
Store.log |
A Store is initialized with a log
property that holds methods for logging.
Specifically, the Store.log
property holds the following methods:
Store.log.debug()
: Logs at the debug levelStore.log.info()
: Logs at the info levelStore.log.warning()
: Logs at the warning levelStore.log.error()
: Logs at the error level
Signature
This signature is for the info
level, but applies to all methods/levels:
undefined Store.log.info(...data)
All logging methods are variadic, they will add logs to the array at store.logs
.
So logging with Store.log.info()
will add the logs to the array at Store.logs.info
.
Example
({ log, part }) => {
log.info('Hey, I am logging')
log.debug(
'I am logging too',
`But you don't see me make a big deal out if it`
)
return part
}
Notes
You can override the default logging methods in the store with a plugin.