Skip to content

Commit

Permalink
fix: don't use unicode chars in env variables (they get ?'d in cloudf…
Browse files Browse the repository at this point in the history
…ormation.getTemplate()
  • Loading branch information
mvayngrib committed Mar 4, 2018
1 parent 22ad48a commit cf833ad
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 59 deletions.
2 changes: 1 addition & 1 deletion serverless-uncompiled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ provider:
BLOCKCHAIN: ${{self:custom.blockchain}}
CORDA_API_URL: ${{self:custom.corda.apiUrl}}
CORDA_API_KEY: ${{self:custom.corda.apiKey}}
DEBUG: 'λ*,*tradle*'
DEBUG: 'lambda*,*tradle*'
DEBUG_LEVEL: ${{self:custom.vars.debug.level, self:custom.defaults.debug.level}}
DEBUG_FORMAT: ${{self:custom.vars.debug.format, self:custom.defaults.debug.format}}
SERVERLESS_PREFIX: ${{self:custom.prefix}}
Expand Down
52 changes: 0 additions & 52 deletions src/console.ts

This file was deleted.

3 changes: 2 additions & 1 deletion src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ const constants = {
'auth',
'inbox'
]
}
},
ROOT_LOGGING_NAMESPACE: 'tradle'
}

export = constants
7 changes: 3 additions & 4 deletions src/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import randomName = require('random-name')
import { allSettled, RESOLVED_PROMISE } from './utils'
import { randomString } from './crypto'
import { IDebug, ILambdaAWSExecutionContext, Lambda, IRequestContext, CloudName } from './types'
import { WARMUP_SOURCE_NAME } from './constants'
import { WARMUP_SOURCE_NAME, ROOT_LOGGING_NAMESPACE } from './constants'
import Logger, { Level } from './logger'

export default class Env {
Expand Down Expand Up @@ -100,11 +100,10 @@ export default class Env {

this.SERVERLESS_ARTIFACTS_PATH = `serverless/${SERVERLESS_SERVICE_NAME}/${SERVERLESS_STAGE}`

const namespace = `λ:${this.FUNCTION_NAME}`
this.logger = new Logger({
namespace,//: this.TESTING ? '' : namespace,
namespace: ROOT_LOGGING_NAMESPACE,
writer: global.console,
// writer: this.TESTING ? { log: debug(`λ:${this.FUNCTION_NAME}`) } : global.console,
// writer: this.TESTING ? { log: debug(`lambda:${this.FUNCTION_NAME}`) } : global.console,
outputFormat: props.DEBUG_FORMAT || 'text',
context: {},
level: 'DEBUG_LEVEL' in props ? Number(props.DEBUG_LEVEL) : Level.DEBUG,
Expand Down
2 changes: 1 addition & 1 deletion src/lambda.ts
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ Previous exit stack: ${this.lastExitStack}`)

context.callbackWaitsForEmptyEventLoop = false
this.logger = this.tradle.logger.sub({
namespace: `λ:${this.shortName}`,
namespace: `lambda:${this.shortName}`,
context: this.reqCtx,
writer: console
})
Expand Down

0 comments on commit cf833ad

Please sign in to comment.