Skip to content

Commit c712596

Browse files
BKNDLSS-32284 Apply LogLevels in the JSCodeRunner from the context
1 parent ad3bc4c commit c712596

File tree

3 files changed

+27
-12
lines changed

3 files changed

+27
-12
lines changed

lib/server-code/runners/tasks/executor.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,22 @@ function initClientSdk(task, opts) {
103103

104104
Object.assign(Backendless.Config, opts.backendless.public)
105105

106-
Backendless.initApp(task.applicationId, task.initAppData.apiKey || task.initAppData.secretKey)
106+
const loggers = task.loggers || []
107+
108+
const logLevels = loggers.reduce((map, logConfig) => {
109+
map[logConfig.name] = logConfig.level.toLowerCase()
110+
111+
return map
112+
}, {})
113+
114+
Backendless.initApp({
115+
appId : task.applicationId,
116+
apiKey : task.initAppData.apiKey || task.initAppData.secretKey,
117+
logging: {
118+
loadLevels: false,
119+
levels : logLevels
120+
}
121+
})
107122

108123
if (opts.backendless.forwardableHeaders) {
109124
applyTransferringHeaders(task, opts.backendless.forwardableHeaders)

package-lock.json

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

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "backendless-coderunner",
3-
"version": "6.7.4",
3+
"version": "7.0.0",
44
"description": "Backendless CodeRunner for Node.js",
55
"scripts": {
66
"test": "mocha",
@@ -35,7 +35,7 @@
3535
"backendless"
3636
],
3737
"dependencies": {
38-
"backendless": "^6.7.0",
38+
"backendless": "^7.0.0",
3939
"backendless-js-services-core": "^0.0.19",
4040
"commander": "^8.3.0",
4141
"glob": "^7.2.0",

0 commit comments

Comments
 (0)