commit-analyzer icon indicating copy to clipboard operation
commit-analyzer copied to clipboard

Is there a way to turn off logs?

Open asibilia opened this issue 3 years ago • 1 comments

Since every commit being analyzed is logged (with the description as well as the commit message) we sometimes ned up with thousands of lines of logs in our GH Actions consoles when merging together multiple branches... to the point where the browser almost crashes.

asibilia avatar May 20 '22 15:05 asibilia

You should be able to turn off logging by setting the logger to return undefined or true.

Something like this:

const context = {
  commits: [],
  logger: {
    log: () => undefined
  }
}
let bump = await commit.analyzeCommits(pluginConfig, context)

// or one line
let bump = await commit.analyzeCommits(pluginConfig, { commits, logger: { log: () => undefined } })

For more context:

  • logger is being set here https://github.com/semantic-release/commit-analyzer/blob/master/index.js#L27
  • Then the logger.log function used first here https://github.com/semantic-release/commit-analyzer/blob/master/index.js#L44

jveldboom avatar Feb 01 '23 03:02 jveldboom