Style
/ API Reference / PluginsStyle
/ API Reference / Pluginslogger
This plugin logs style objects to the console for debugging purposes.
The Gist
import { loggerPlugin } from '@weser/style'
const plugin = loggerPlugin({
prefix: '[Style]',
stringify: false,
clone: true,
})
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| config | Config? | {} | Configuration options for the logger. |
Config
| Property | Type | Default | Description |
|---|---|---|---|
| prefix | string? | '' | A prefix string to prepend to each log message. |
| stringify | boolean? | false | Whether to stringify the style object using JSON.stringify. |
| clone | boolean? | true | Whether to clone the style object before logging (to avoid mutations). |
Returns
(Plugin) A plugin function that can be passed to the createRenderer function.
© 2024-present Robin Weser. All Rights Reserved.