Skip to content

Commit

Permalink
fix: console.log
Browse files Browse the repository at this point in the history
  • Loading branch information
dnalborczyk committed Jun 2, 2022
1 parent 63c7b43 commit d85bb15
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 4 deletions.
1 change: 0 additions & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ module.exports = {
// TODO FIXME turn off temporary, to make eslint pass
'class-methods-use-this': 'off',
'lines-between-class-members': 'off',
'no-console': 'off',
'no-restricted-syntax': 'off',
'no-underscore-dangle': 'off',
},
Expand Down
1 change: 1 addition & 0 deletions examples/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ module.exports = {
'import/no-extraneous-dependencies': 'off',
'import/no-unresolved': 'off',
'import/prefer-default-export': 'off',
'no-console': 'off',
},
}
5 changes: 3 additions & 2 deletions src/lambda/handler-runner/docker-runner/DockerContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,9 @@ export default class DockerContainer {

await new Promise((resolve, reject) => {
dockerStart.all.on('data', (data) => {
const str = data.toString()
console.log(str)
const str = String(data)
log.error(str)

if (str.includes('Lambda API listening on port')) {
resolve()
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { createRequire } from 'node:module'
import { performance } from 'node:perf_hooks'
import process from 'node:process'
import { log } from '@serverless/utils/log.js'
import clearModule from './clearModule.js'

const { assign } = Object
Expand Down Expand Up @@ -56,7 +57,7 @@ export default class InProcessRunner {
// eslint-disable-next-line import/no-dynamic-require
;({ [this.#handlerName]: handler } = require(this.#handlerPath))
} catch (err) {
console.log(err)
log.error(err)
}

if (typeof handler !== 'function') {
Expand Down
1 change: 1 addition & 0 deletions src/utils/logRoutes.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export default function logRoutes(routeInfo) {
}
const maxLength = getMaxHttpMethodNameLength(routeInfo)

// eslint-disable-next-line no-console
console.log(
boxen(
routeInfo
Expand Down
7 changes: 7 additions & 0 deletions tests/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
'use strict'

module.exports = {
rules: {
'no-console': 'off',
},
}

0 comments on commit d85bb15

Please sign in to comment.