How to use the @haul-bundler/core.Logger.Level function in @haul-bundler/core

To help you get started, we’ve selected a few @haul-bundler/core 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 callstack / haul / packages / haul-cli / src / main.ts View on Github external
handler(...args) {
          runtime.startCommand(
            commandModule.command || 'unknown',
            process.argv
          );

          if (args[0].verbose) {
            runtime.logger.minLoggingLevel = Logger.Level.Debug;
          }

          if (args[0].outputFile && typeof args[0].outputFile === 'string') {
            runtime.logger.enableFileLogging(args[0].outputFile, {
              json: Boolean(args[0].json),
            });
          }

          try {
            const results = commandModule.handler(...args) as
              | undefined
              | Promise;
            if (results && results.catch) {
              results.catch(error => {
                runtime.unhandledError(error);
                runtime.complete(1);