How to use the bs-logger.createLogger function in bs-logger

To help you get started, we’ve selected a few bs-logger examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kulshekhar / ts-jest / src / util / logger.ts View on Github external
[LogContexts.logLevel]: LogLevels.trace,
    version: require('../../package.json').version,
  },
  targets: process.env.TS_JEST_LOG || undefined,
})

/**
 * @internal
 */
export let rootLogger = createLogger(buildOptions())

backportTsJestDebugEnvVar(rootLogger)

// re-create the logger if the env var has been backported
if (original !== process.env.TS_JEST_LOG) {
  rootLogger = createLogger(buildOptions())
}
github kulshekhar / ts-jest / src / util / logger.ts View on Github external
const original = process.env.TS_JEST_LOG

const buildOptions = () => ({
  context: {
    [LogContexts.package]: 'ts-jest',
    [LogContexts.logLevel]: LogLevels.trace,
    version: require('../../package.json').version,
  },
  targets: process.env.TS_JEST_LOG || undefined,
})

/**
 * @internal
 */
export let rootLogger = createLogger(buildOptions())

backportTsJestDebugEnvVar(rootLogger)

// re-create the logger if the env var has been backported
if (original !== process.env.TS_JEST_LOG) {
  rootLogger = createLogger(buildOptions())
}
github kulshekhar / ts-jest / src / cli / config / migrate.ts View on Github external
export const run: CliCommand = async (args: Arguments /*, logger: Logger*/) => {
  const nullLogger = createLogger({ targets: [] })
  const file = args._[0]
  const filePath = resolve(process.cwd(), file)
  const footNotes: string[] = []
  if (!existsSync(filePath)) {
    throw new Error(`Configuration file ${file} does not exists.`)
  }
  const name = basename(file)
  const isPackage = name === 'package.json'
  if (!/\.(js|json)$/.test(name)) {
    throw new TypeError(`Configuration file ${file} must be a JavaScript or JSON file.`)
  }
  let actualConfig: jest.InitialOptions = require(filePath)
  if (isPackage) {
    actualConfig = (actualConfig as any).jest
  }
  if (!actualConfig) actualConfig = {}