
Security News
libxml2 Maintainer Ends Embargoed Vulnerability Reports, Citing Unsustainable Burden
Libxml2’s solo maintainer drops embargoed security fixes, highlighting the burden on unpaid volunteers who keep critical open source software secure.
pinia-logger
Advanced tools
For Nuxt users, see pinia-logger-nuxt
yarn add pinia-logger
or
npm install pinia-logger --save-dev
import { PiniaLogger } from "pinia-logger";
const pinia = createPinia();
// Defaults are:
// const defaultOptions = {
// logErrors: true,
// disabled: false,
// expanded: true,
// showStoreName: true,
// showDuration: false,
// showTime: true,
// filter: () => true
// actions: undefined
// logger: console
// }
pinia.use(
PiniaLogger({
expanded: true,
disabled: process.env.mode === "production",
// use a filter to only log certain actions
filter: ({ name }) => name !== "incrementCounter",
// alternatively, you can specify the actions you want to log
// if undefined, all actions will be logged
actions: ["decrementCounter"],
})
);
app.use(pinia);
You can also set the logger options in the store. For example:
export const useCounterStore = defineStore({
id: "counter",
state: () => ({
counter: 0,
}),
actions: {
incrementCounter() {
this.counter++;
},
decrementCounter() {
this.counter--;
},
},
// you can also set the logger options in the store
logger: {
expanded: true,
disabled: process.env.mode === "production",
// use a filter to only log certain actions
filter: ({ name }) => name !== "incrementCounter",
// alternatively, you can specify the actions you want to log
// if undefined, all actions will be logged
actions: ["decrementCounter"],
},
});
// or using setup style store definition
export const useCounterStore = defineStore(
"counter",
() => {
const count = ref(0);
const increment = () => count.value++;
const decrement = () => count.value--;
return {
count,
increment,
decrement,
};
},
// use the third argument to set the logger options
{
logger: {
// only log the decrement action
actions: ["decrementCounter"],
},
}
);
import { PiniaLoggerOptions }
// Options interface is:
export interface PiniaLoggerOptions {
disabled?: boolean;
expanded?: boolean;
showDuration?: boolean;
showTime?: boolean;
showPineapple?: boolean;
showStoreName?: boolean;
logErrors?: boolean;
filter?: (action: PiniaActionListenerContext) => boolean;
actions?: KeyOfStoreActions<Store>[]
logger?: Logger
}
1.3.10 - 2023-01-16
{...foo}
showTime
optionactions
optionlogger
property1.3.6 - 2022-09-20
filter
option. Use a filter function to only log certain actionsFAQs
Lightweight logger for Pinia
The npm package pinia-logger receives a total of 8,361 weekly downloads. As such, pinia-logger popularity was classified as popular.
We found that pinia-logger demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Libxml2’s solo maintainer drops embargoed security fixes, highlighting the burden on unpaid volunteers who keep critical open source software secure.
Research
Security News
Socket investigates hidden protestware in npm packages that blocks user interaction and plays the Ukrainian anthem for Russian-language visitors.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.