Skip to content

Commit

Permalink
chore(deps): bump winston from 3.16.0 to 3.17.0 (#1357)
Browse files Browse the repository at this point in the history
* chore(deps): bump winston from 3.16.0 to 3.17.0

Bumps [winston](https://github.com/winstonjs/winston) from 3.16.0 to 3.17.0.
- [Release notes](https://github.com/winstonjs/winston/releases)
- [Changelog](https://github.com/winstonjs/winston/blob/master/CHANGELOG.md)
- [Commits](winstonjs/winston@v3.16.0...v3.17.0)

---
updated-dependencies:
- dependency-name: winston
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* chore: update winston logger types

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Bertrand Marron <[email protected]>
  • Loading branch information
dependabot[bot] and tusbar authored Nov 12, 2024
1 parent 0e67eaf commit 0400335
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 30 deletions.
2 changes: 1 addition & 1 deletion codegen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"mustache": "^4.2.0",
"remark": "^15.0.1",
"strip-markdown": "^6.0.0",
"winston": "^3.16.0"
"winston": "^3.17.0"
},
"devDependencies": {
"@types/bluebird": "^3.5.42",
Expand Down
37 changes: 22 additions & 15 deletions codegen/utils/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,32 @@ const colors = [
]

export const logger = winston.createLogger({
format: winston.format.printf((info) => {
const moduleName: string = info.packageName ?? info.schemaName ?? ''
format: winston.format.printf(
(
info: winston.Logform.TransformableInfo & {
packageName?: string
schemaName?: string
},
) => {
const moduleName: string = info.packageName ?? info.schemaName ?? ''

const value = [...moduleName].reduce(
(accumulator: number, string: string) => accumulator + string.codePointAt(0)!,
0,
)
const value = [...moduleName].reduce(
(accumulator: number, string: string) => accumulator + string.codePointAt(0)!,
0,
)

const color = colors[value % colors.length]
const color = colors[value % colors.length]

if (info.packageName) {
return `${color(`@sp-api-sdk/${moduleName}`)}: ${info.message}`
}
if (info.packageName) {
return `${color(`@sp-api-sdk/${moduleName}`)}: ${info.message}`
}

if (info.schemaType) {
return `${color(`@sp-api-sdk/schemas: ${chalk.bold(info.schemaType)}(${moduleName})`)}: ${info.message}`
}
if (info.schemaType) {
return `${color(`@sp-api-sdk/schemas: ${chalk.bold(info.schemaType)}(${moduleName})`)}: ${info.message}`
}

return `${color('@sp-api-sdk')}: ${info.message}`
}),
return `${color('@sp-api-sdk')}: ${info.message}`
},
),
transports: [new winston.transports.Console()],
})
28 changes: 14 additions & 14 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0400335

Please sign in to comment.