How to use the @slack/web-api.LogLevel.DEBUG function in @slack/web-api

To help you get started, we’ve selected a few @slack/web-api 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 matrix-org / matrix-appservice-slack / src / SlackClientFactory.ts View on Github external
setName: () => {},
                debug: (msg: string) => {
                    // non-ideal way to detect calls to slack.
                    webLog.debug.bind(webLog);
                    if (!this.onRemoteCall) { return; }
                    const match = /apiCall\('([\w\.]+)'\) start/.exec(msg);
                    if (match && match[1]) {
                        this.onRemoteCall(match[1]);
                    }
                    webLog.debug(msg);
                },
                warn: webLog.warn.bind(webLog),
                info: webLog.info.bind(webLog),
                error: webLog.error.bind(webLog),
            } as Logger,
            logLevel: LogLevel.DEBUG,
            ...opts,
        });
        try {
            const teamInfo = (await slackClient.team.info()) as TeamInfoResponse;
            const auth = (await slackClient.auth.test()) as AuthTestResponse;
            const user = (await slackClient.users.info({user: auth.user_id})) as UsersInfoResponse;
            log.debug("Created new team client for", teamInfo.team.name);
            return { slackClient, team: teamInfo.team, auth, user };
        } catch (ex) {
            throw Error("Could not create team client: " + ex.data.error);
        }
    }
}
github matrix-org / matrix-appservice-slack / src / SlackClientFactory.ts View on Github external
                getLevel: () => LogLevel.DEBUG,
                setLevel: () => {}, // We don't care about these.