Skip to content

Commit

Permalink
Merge b7c8ee3 into 6e5b6d7
Browse files Browse the repository at this point in the history
  • Loading branch information
philipp-heyse committed Feb 8, 2018
2 parents 6e5b6d7 + b7c8ee3 commit 50dc830
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 13 deletions.
14 changes: 10 additions & 4 deletions .travis.yml
Expand Up @@ -17,19 +17,25 @@ matrix:
before_script:
- if [[ "$TRAVIS_NODE_VERSION" == "8" && "$TRAVIS_OS_NAME" == "linux" ]]; then npm run lint; fi
- if [[ "$TRAVIS_NODE_VERSION" == "8" && "$TRAVIS_OS_NAME" == "linux" ]]; then npm run check; fi
- wget https://github.com/shopgate/connect-sdk-integration-test/archive/master.zip
- mkdir integration
- unzip master.zip -d integration
- cd integration/connect-sdk-integration-test-master
- npm i --no-package-lock
- cd ../../

install:
- npm i --no-package-lock

script:
- cd integration/connect-sdk-integration-test-master
- ls -la
- npm run test
- cd ../../
- if [[ "$TRAVIS_NODE_VERSION" == "8" && "$TRAVIS_OS_NAME" == "linux" ]]; then npm run cover; else npm t; fi

after_script:
- if [[ "$TRAVIS_NODE_VERSION" == "8" && "$TRAVIS_OS_NAME" == "linux" ]]; then cat ./build/lcov.info | ./node_modules/coveralls/bin/coveralls.js; fi

notifications:
email: false

branches:
only:
- master
11 changes: 9 additions & 2 deletions lib/app/backend/extensionRuntime/StepExecutor.js
Expand Up @@ -29,11 +29,18 @@ class StepExecutor {
ignoreInitial: true
}

const streams = []

if (process.env.INTEGRATION_TEST === 'true') {
streams.push({level: process.env.LOG_LEVEL || 'debug', stream: process.stdout})
} else {
streams.push({stream: new LogStream(osLocale.sync().replace('_', '-')), type: 'raw', level: 'debug'})
}

// Init special step logger with its own log level
this.stepLogger = bunyan.createLogger({
name: '\u0008',
streams: [{stream: new LogStream(osLocale.sync().replace('_', '-')), type: 'raw', level: 'debug'}],
type: 'raw'
streams
})
this.stepLogger.plain = console.log
}
Expand Down
23 changes: 16 additions & 7 deletions lib/logger.js
Expand Up @@ -2,18 +2,27 @@ const bunyan = require('bunyan')
const LogStream = require('./utils/logstream')
const osLocale = require('os-locale')

const streams = []

if (process.env.INTEGRATION_TEST === 'true') {
streams.push({
level: process.env.LOG_LEVEL || 'debug',
stream: process.stdout
})
} else {
streams.push({
level: process.env.LOG_LEVEL || 'info',
stream: new LogStream(osLocale.sync().replace('_', '-')),
type: 'raw'
})
}

/**
* @type {{trace:Function, debug:Function, info:Function, warn:Function, error:Function, child:Function, level:Function, levels:Function}}
*/
const logger = bunyan.createLogger({
name: '\u0008',
streams: [
{
level: process.env.LOG_LEVEL || 'info',
stream: new LogStream(osLocale.sync().replace('_', '-')),
type: 'raw'
}
]
streams
})
logger.plain = console.log

Expand Down

0 comments on commit 50dc830

Please sign in to comment.