Skip to content

Commit

Permalink
ref: Allow for all logger levels in Octokit (#390)
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilogorek authored May 10, 2022
1 parent 83da31c commit 8fc39c2
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/utils/githubApi.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Octokit } from '@octokit/rest';

import { LogLevel, logger } from '../logger';
import { logger } from '../logger';

import { ConfigurationError } from './errors';

Expand Down Expand Up @@ -103,14 +103,9 @@ export function getGitHubClient(token = ''): Octokit {
if (!_GitHubClientCache[githubApiToken]) {
const attrs: any = {
auth: `token ${githubApiToken}`,
log: logger,
};

if (logger.level >= LogLevel.Debug) {
attrs.log = {
info: (message: string) => logger.debug(message),
};
}

// eslint-disable-next-line @typescript-eslint/no-var-requires
const { retry } = require('@octokit/plugin-retry');
const octokitWithRetries = Octokit.plugin(retry);
Expand Down

0 comments on commit 8fc39c2

Please sign in to comment.