Skip to content

Commit 54130ea

Browse files
committed
chore: read configs for stack driver
1 parent 5d00b1e commit 54130ea

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@athenna/logger",
3-
"version": "5.4.0",
3+
"version": "5.5.0",
44
"description": "The Athenna logging solution. Log in stdout, files and buckets.",
55
"license": "MIT",
66
"author": "João Lenon <lenon@athenna.io>",

src/drivers/StackDriver.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
* file that was distributed with this source code.
88
*/
99

10+
import { debug } from '#src/debug'
1011
import { Json } from '@athenna/common'
1112
import { Driver } from '#src/drivers/Driver'
1213
import { DriverFactory } from '#src/factories/DriverFactory'
13-
import { debug } from '#src/debug'
1414

1515
export class StackDriver extends Driver {
1616
public transport(level: string, message: any): Promise<any> {
@@ -25,10 +25,15 @@ export class StackDriver extends Driver {
2525
this.driverConfig.channels.join(', ')
2626
)
2727

28-
return Promise.all(
29-
this.driverConfig.channels.map(c =>
30-
DriverFactory.fabricate(c, configs).transport(level, message)
28+
const promises = this.driverConfig.channels.map(channel => {
29+
const channelConfig = configs?.[channel]
30+
31+
return DriverFactory.fabricate(channel, channelConfig).transport(
32+
level,
33+
message
3134
)
32-
)
35+
})
36+
37+
return Promise.all(promises)
3338
}
3439
}

0 commit comments

Comments
 (0)