feat: deprecated logLevel option (#8293)

* feat: deprecated logLevel option

* feat: deprecated logLevel option

* docs: update logging
This commit is contained in:
Michael Kriese 2021-01-14 13:11:23 +01:00 committed by GitHub
parent c3e11ea46a
commit 76ada5e7d5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 13 additions and 10 deletions

View file

@ -38,7 +38,6 @@ e.g. apply one set of labels for `backend/package.json` and a different set of l
module.exports = {
npmrc: '//registry.npmjs.org/:_authToken=abc123',
baseDir: '/tmp/renovate',
logLevel: 'debug',
includeForks: true,
gradle: { enabled: false },
};
@ -53,6 +52,8 @@ $ node renovate --help
To configure any `<list>` items, separate with commas.
E.g. `renovate --labels=renovate,dependency`.
To enable debug logging export `LOG_LEVEL=debug` to your environment.
### renovate.json
If you add a `renovate.json` file to the root of your repository, you can use this to override default settings.

View file

@ -168,6 +168,8 @@ By configuring using the environment it means that debug logging starts from the
Additionally, if you configure `LOG_FORMAT=json` in env then logging will be done in JSON format instead of "pretty" format, which is usually better if you're doing any ingestion or parsing of the logs.
Warning: Configuring `logLevel` config option or `--log-level` cli option is deprecated and will be removed in a major version.
## onboarding
Set this to `false` if (a) you configure Renovate entirely on the bot side (i.e. empty `renovate.json` in repositories) and (b) you wish to run Renovate on every repository the bot has access to, and (c) you wish to skip the onboarding PRs.

View file

@ -99,7 +99,6 @@ metadata:
data:
config.json: |-
{
"logLevel" : "debug",
"repositories": ["orgname/repo","username/repo"],
"dryRun" : "true"
}
@ -274,7 +273,6 @@ module.exports = {
endpoint: 'https://self-hosted.gitlab/api/v4/',
token: '**gitlab_token**',
platform: 'gitlab',
logLevel: 'debug',
onboardingConfig: {
extends: ['config:base'],
},

View file

@ -1,5 +1,4 @@
// @ts-ignore
module.exports = {
token: 'abcdefg',
logLevel: 'error'
};

View file

@ -1,7 +1,6 @@
// @ts-ignore
module.exports = {
token: 'abcdefg',
logLevel: 'error',
force: {
schedule: null,
}

View file

@ -342,11 +342,10 @@ const options: RenovateOptions[] = [
// Log options
{
name: 'logLevel',
description: 'Logging level',
description: 'Logging level. Deprecated, use `LOG_LEVEL` environment.',
stage: 'global',
type: 'string',
allowedValues: ['fatal', 'error', 'warn', 'info', 'debug', 'trace'],
default: 'info',
env: 'LOG_LEVEL',
},
{

View file

@ -37,7 +37,6 @@ describe('config/file', () => {
"platform": "github",
"token":"abcdef",
"logFileLevel": "warn",
"logLevel": "info",
"onboarding": false,
"gitAuthor": "Renovate Bot <renovate@whitesourcesoftware.com>"
"onboardingConfig": {

View file

@ -80,8 +80,14 @@ export async function parseConfigs(
delete config.privateKeyPath;
}
// Set log level
levels('stdout', config.logLevel);
// Deprecated set log level: https://github.com/renovatebot/renovate/issues/8291
// istanbul ignore if
if (config.logLevel) {
logger.warn(
'Configuring logLevel is deprecated. Use LOG_LEVEL environment variable instead'
);
levels('stdout', config.logLevel);
}
if (config.logContext) {
// This only has an effect if logContext was defined via file or CLI, otherwise it would already have been detected in env