Skip to content

Commit

Permalink
Updates deprecation warnings and snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
TinaHeiligers committed Mar 17, 2021
1 parent 7850877 commit 45971d9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/cli/serve/serve.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,11 @@ function applyConfigOverrides(rawConfig, opts, extraCliOptions) {
set('logging.root.level', 'off');
}
if (opts.verbose) {
// Only set logging.verbose to true when KP logging isn't configured.
if (!has('rawConfig.logging.root.appenders')) {
set('logging.verbose', true);
} else {
if (has('logging.root.appenders')) {
set('logging.root.level', 'all');
} else {
// Only set logging.verbose to true for legacy logging when KP logging isn't configured.
set('logging.verbose', true);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ describe('core deprecations', () => {
});
expect(messages).toMatchInlineSnapshot(`
Array [
"\\"logging.events.log\\" has been deprecated and will be removed in 8.0. Moving forward, you can use \\"logging.root.level\\" in your logging configuration. ",
"\\"logging.events.log\\" has been deprecated and will be removed in 8.0. Moving forward, log levels can be customized on a per-logger basis using the new logging configuration. ",
]
`);
});
Expand Down
7 changes: 5 additions & 2 deletions src/core/server/config/deprecation/core_deprecations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@ const verboseLoggingDeprecation: ConfigDeprecation = (settings, fromPath, log) =
};

const jsonLoggingDeprecation: ConfigDeprecation = (settings, fromPath, log) => {
// We silence the deprecation warning when running in development mode because
// the dev CLI code in src/dev/cli_dev_mode/using_server_process.ts manually
// specifies `--logging.json=false`. Since it's executed in a child process, the
// ` legacyLoggingConfigSchema` returns `true` for the TTY check on `process.stdout.isTTY`
if (has(settings, 'logging.json') && settings.env !== 'development') {
log(
'"logging.json" has been deprecated and will be removed ' +
Expand Down Expand Up @@ -211,7 +215,7 @@ const logEventsLogDeprecation: ConfigDeprecation = (settings, fromPath, log) =>
if (has(settings, 'logging.events.log')) {
log(
'"logging.events.log" has been deprecated and will be removed ' +
'in 8.0. Moving forward, you can use "logging.root.level" in your logging configuration. '
'in 8.0. Moving forward, log levels can be customized on a per-logger basis using the new logging configuration. '
);
}
return settings;
Expand All @@ -229,7 +233,6 @@ const logEventsErrorDeprecation: ConfigDeprecation = (settings, fromPath, log) =

const logFilterDeprecation: ConfigDeprecation = (settings, fromPath, log) => {
if (has(settings, 'logging.filter')) {
// usage: logging.filter.cookie=none or logging.filter.authorization=none
log('"logging.filter" has been deprecated and will be removed ' + 'in 8.0. ');
}
return settings;
Expand Down

0 comments on commit 45971d9

Please sign in to comment.