wrapLogger static method
DeprecationProcessingLogger
wrapLogger(
- Logger? logger,
- Iterable<
Deprecation> ? silenceDeprecations, - Iterable<
Deprecation> ? fatalDeprecations, - Iterable<
Deprecation> ? futureDeprecations, { - bool color = false,
Wraps logger
to process deprecations within an ImportCache.
This wrapped logger will handle the deprecation options, but will not limit repetition, as it can be re-used across parses. A logger passed to an ImportCache or AsyncImportCache should generally be wrapped here first, unless it's already been wrapped to process deprecations, in which case this method has no effect.
Implementation
static DeprecationProcessingLogger wrapLogger(
Logger? logger,
Iterable<Deprecation>? silenceDeprecations,
Iterable<Deprecation>? fatalDeprecations,
Iterable<Deprecation>? futureDeprecations,
{bool color = false}) {
if (logger is DeprecationProcessingLogger) return logger;
return DeprecationProcessingLogger(logger ?? Logger.stderr(color: color),
silenceDeprecations: {...?silenceDeprecations},
fatalDeprecations: {...?fatalDeprecations},
futureDeprecations: {...?futureDeprecations},
// TODO - sass/dart-sass#2390: We should limit repetition within a given
// compilation while allowing it across different compilations (such as
// with `--watch`).
limitRepetition: true);
}