How to use the bs-logger.LogLevels.trace 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 / compiler.ts View on Github external
logger.debug({ fileName }, `updateMemoryCache()`)
      if (memoryCache.contents[fileName] !== code) {
        memoryCache.contents[fileName] = code
        memoryCache.versions[fileName] = (memoryCache.versions[fileName] || 0) + 1
      }
    }

    // Create the compiler host for type checking.
    const serviceHostDebugCtx = {
      [LogContexts.logLevel]: LogLevels.debug,
      namespace: 'ts:serviceHost',
      call: null,
    }
    const serviceHostTraceCtx = {
      ...serviceHostDebugCtx,
      [LogContexts.logLevel]: LogLevels.trace,
    }

    const serviceHost = {
      getScriptFileNames: () => Object.keys(memoryCache.versions),
      getScriptVersion: (fileName: string) => {
        const normalizedFileName = normalize(fileName)
        const version = memoryCache.versions[normalizedFileName]

        // We need to return `undefined` and not a string here because TypeScript will use
        // `getScriptVersion` and compare against their own version - which can be `undefined`.
        // If we don't return `undefined` it results in `undefined === "undefined"` and run
        // `createProgram` again (which is very slow). Using a `string` assertion here to avoid
        // TypeScript errors from the function signature (expects `(x: string) => string`).
        return version === undefined ? ((undefined as any) as string) : String(version)
      },
      getScriptSnapshot(fileName: string) {
github kulshekhar / ts-jest / src / util / logger.ts View on Github external
const buildOptions = () => ({
  context: {
    [LogContexts.package]: 'ts-jest',
    [LogContexts.logLevel]: LogLevels.trace,
    version: require('../../package.json').version,
  },
  targets: process.env.TS_JEST_LOG || undefined,
})