1
0
mirror of https://github.com/sasjs/adapter.git synced 2026-01-08 13:00:05 +00:00

chore(*): refactor to use logger if available

This commit is contained in:
Krishna Acondy
2021-06-25 09:14:29 +01:00
parent 97d45e87ec
commit 2b16be3aef
4 changed files with 20 additions and 9 deletions

View File

@@ -158,6 +158,8 @@ export class SessionManager {
etag: string | null,
accessToken?: string
) {
const logger = process.logger || console
let sessionState = session.state
const stateLink = session.links.find((l: any) => l.rel === 'state')
@@ -170,7 +172,7 @@ export class SessionManager {
) {
if (stateLink) {
if (this.debug && !this.printedSessionState.printed) {
console.log('Polling session status...')
logger.info('Polling session status...')
this.printedSessionState.printed = true
}
@@ -186,7 +188,7 @@ export class SessionManager {
sessionState = state.trim()
if (this.debug && this.printedSessionState.state !== sessionState) {
console.log(`Current session state is '${sessionState}'`)
logger.info(`Current session state is '${sessionState}'`)
this.printedSessionState.state = sessionState
this.printedSessionState.printed = false