Browse Source
Task/add stack trace logging for MaxListenersExceededWarning (#7400)
* Add stack trace logging for MaxListenersExceededWarning
* Update changelog
main
Thomas Kaul
6 hours ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
13 additions and
0 deletions
-
CHANGELOG.md
-
apps/api/src/main.ts
|
|
|
@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 |
|
|
|
|
|
|
|
## Unreleased |
|
|
|
|
|
|
|
### Added |
|
|
|
|
|
|
|
- Added the stack trace logging for `MaxListenersExceededWarning` occurrences |
|
|
|
|
|
|
|
### Changed |
|
|
|
|
|
|
|
- Refactored the deprecated animation providers (`provideAnimations()` and `provideNoopAnimations()`) |
|
|
|
|
|
|
|
@ -26,6 +26,15 @@ import { AppModule } from './app/app.module'; |
|
|
|
import { environment } from './environments/environment'; |
|
|
|
|
|
|
|
const logger = new Logger('Bootstrap'); |
|
|
|
const processWarningLogger = new Logger('ProcessWarning'); |
|
|
|
|
|
|
|
process.on('warning', ({ name, stack }) => { |
|
|
|
if (name === 'MaxListenersExceededWarning') { |
|
|
|
// Log the stack trace of MaxListenersExceededWarning occurrences to identify
|
|
|
|
// the event emitter and the call site which registers the listeners
|
|
|
|
processWarningLogger.warn(stack); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
async function bootstrap() { |
|
|
|
// Respect HTTP_PROXY / HTTPS_PROXY / NO_PROXY for outbound HTTP requests
|
|
|
|
|