How to use @slack/logger - 4 common examples

To help you get started, we’ve selected a few @slack/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 slackapi / bolt / src / App.spec.ts View on Github external
}
            },
          }
        }
      )
      const App = await importApp(overrides);

      const clientOptions = { slackApiUrl: 'proxy.slack.com' };
      new App({ authorize: noopAuthorize, signingSecret: '', logLevel: LogLevel.ERROR, clientOptions });

      assert.ok(fakeConstructor.called);

      const [token, options] = fakeConstructor.lastCall.args;
      assert.strictEqual(undefined, token, 'token should be undefined');
      assert.strictEqual(clientOptions.slackApiUrl, options.slackApiUrl);
      assert.strictEqual(LogLevel.ERROR, options.logLevel, 'override logLevel');
    })
    // TODO: tests for ignoreSelf option
github slackapi / bolt / src / App.spec.ts View on Github external
const overrides = mergeOverrides(
        withNoopAppMetadata(),
        {
          '@slack/web-api': {
            WebClient: class {
              constructor() {
                fakeConstructor(...arguments)
              }
            },
          }
        }
      )
      const App = await importApp(overrides);

      const clientOptions = { slackApiUrl: 'proxy.slack.com' };
      new App({ authorize: noopAuthorize, signingSecret: '', logLevel: LogLevel.ERROR, clientOptions });

      assert.ok(fakeConstructor.called);

      const [token, options] = fakeConstructor.lastCall.args;
      assert.strictEqual(undefined, token, 'token should be undefined');
      assert.strictEqual(clientOptions.slackApiUrl, options.slackApiUrl);
      assert.strictEqual(LogLevel.ERROR, options.logLevel, 'override logLevel');
    })
    // TODO: tests for ignoreSelf option
github slackapi / bolt / src / ExpressReceiver.ts View on Github external
constructor({
    signingSecret = '',
    logger = new ConsoleLogger(),
    endpoints = { events: '/slack/events' },
    agent = undefined,
    clientTls = undefined,
  }: ExpressReceiverOptions) {
    super();

    this.app = express();
    this.app.use(this.errorHandler.bind(this));
    // TODO: what about starting an https server instead of http? what about other options to create the server?
    this.server = createServer(this.app);
    this.axios = axios.create(Object.assign(
      {
        httpAgent: agent,
        httpsAgent: agent,
      },
      clientTls,
github slackapi / bolt / src / ExpressReceiver.spec.ts View on Github external
    getLevel(): LogLevel { return LogLevel.DEBUG; },
    setName(_name: string): void { },

@slack/logger

Logging utility used by Node Slack SDK

MIT
Latest version published 9 months ago

Package Health Score

97 / 100
Full package analysis