File tree Expand file tree Collapse file tree 3 files changed +39
-32
lines changed
packages/sdk/src/modules/loggerModule Expand file tree Collapse file tree 3 files changed +39
-32
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @vue-storefront/sdk " : patch
3+ ---
4+
5+ Export types from sdk logger module
Original file line number Diff line number Diff line change 1- import { LoggerFactory , LoggerType } from "@vue-storefront/logger" ;
2- import type { Module } from "../../types" ;
3- import type { LoggerModuleConfig } from "./types" ;
4- import { injectMetadata } from "./injectMetadata" ;
5- import { isInvalidConfig } from "./utils" ;
6-
7- export const loggerModule = ( options ?: LoggerModuleConfig ) => {
8- const logger =
9- options ?. handler ?? LoggerFactory . create ( LoggerType . ConsolaGcp , options ) ;
10-
11- if ( isInvalidConfig ( options ) ) {
12- console . warn (
13- `Both 'handler' and other config options are provided to logger's configuration.
14- In such case 'handler' will be used and other options will be ignored as those are
15- supported only by the built-in logger.
16- If you want to use other options, please remove 'handler' from the configuration.
17- If you want to use your handler, please remove other options from the configuration.`
18- ) ;
19- }
20-
21- const loggerWithMetadata = injectMetadata ( logger , {
22- alokai : {
23- context : "storefront" ,
24- } ,
25- } ) ;
26-
27- return {
28- connector : {
29- ...loggerWithMetadata ,
30- } ,
31- } satisfies Module ;
32- } ;
1+ export { loggerModule } from "./module" ;
2+ export * from "./types" ;
Original file line number Diff line number Diff line change 1+ import { LoggerFactory , LoggerType } from "@vue-storefront/logger" ;
2+ import type { Module } from "../../types" ;
3+ import type { LoggerModuleConfig } from "./types" ;
4+ import { injectMetadata } from "./injectMetadata" ;
5+ import { isInvalidConfig } from "./utils" ;
6+
7+ export const loggerModule = ( options ?: LoggerModuleConfig ) => {
8+ const logger =
9+ options ?. handler ?? LoggerFactory . create ( LoggerType . ConsolaGcp , options ) ;
10+
11+ if ( isInvalidConfig ( options ) ) {
12+ console . warn (
13+ `Both 'handler' and other config options are provided to logger's configuration.
14+ In such case 'handler' will be used and other options will be ignored as those are
15+ supported only by the built-in logger.
16+ If you want to use other options, please remove 'handler' from the configuration.
17+ If you want to use your handler, please remove other options from the configuration.`
18+ ) ;
19+ }
20+
21+ const loggerWithMetadata = injectMetadata ( logger , {
22+ alokai : {
23+ context : "storefront" ,
24+ } ,
25+ } ) ;
26+
27+ return {
28+ connector : {
29+ ...loggerWithMetadata ,
30+ } ,
31+ } satisfies Module ;
32+ } ;
You can’t perform that action at this time.
0 commit comments