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 = { module.exports = {
npmrc: '//registry.npmjs.org/:_authToken=abc123', npmrc: '//registry.npmjs.org/:_authToken=abc123',
baseDir: '/tmp/renovate', baseDir: '/tmp/renovate',
logLevel: 'debug',
includeForks: true, includeForks: true,
gradle: { enabled: false }, gradle: { enabled: false },
}; };
@ -53,6 +52,8 @@ $ node renovate --help
To configure any `<list>` items, separate with commas. To configure any `<list>` items, separate with commas.
E.g. `renovate --labels=renovate,dependency`. E.g. `renovate --labels=renovate,dependency`.
To enable debug logging export `LOG_LEVEL=debug` to your environment.
### renovate.json ### renovate.json
If you add a `renovate.json` file to the root of your repository, you can use this to override default settings. 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. 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 ## 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. 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: data:
config.json: |- config.json: |-
{ {
"logLevel" : "debug",
"repositories": ["orgname/repo","username/repo"], "repositories": ["orgname/repo","username/repo"],
"dryRun" : "true" "dryRun" : "true"
} }
@ -274,7 +273,6 @@ module.exports = {
endpoint: 'https://self-hosted.gitlab/api/v4/', endpoint: 'https://self-hosted.gitlab/api/v4/',
token: '**gitlab_token**', token: '**gitlab_token**',
platform: 'gitlab', platform: 'gitlab',
logLevel: 'debug',
onboardingConfig: { onboardingConfig: {
extends: ['config:base'], extends: ['config:base'],
}, },

View file

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

View file

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

View file

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

View file

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

View file

@ -80,8 +80,14 @@ export async function parseConfigs(
delete config.privateKeyPath; delete config.privateKeyPath;
} }
// Set log level // 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); levels('stdout', config.logLevel);
}
if (config.logContext) { 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 // This only has an effect if logContext was defined via file or CLI, otherwise it would already have been detected in env