@@ -10,6 +10,7 @@ import {
1010 WEB_CLIENT_OPTIONS_IDENTIFIER ,
1111 WebClientOptions ,
1212 getIPV4 ,
13+ logger ,
1314} from '../server' ;
1415import type { Compiler , WebpackPluginInstance } from 'webpack' ;
1516import path from 'path' ;
@@ -56,32 +57,32 @@ export class DevPlugin implements WebpackPluginInstance {
5657
5758 private _stopWhenSIGTERMOrSIGINT ( ) : void {
5859 process . on ( 'SIGTERM' , ( ) => {
59- console . log (
60- chalk `{cyan ${ this . _options . name } Process(${ process . pid } ) SIGTERM, mf server will exit...} `,
60+ logger . info (
61+ ` ${ this . _options . name } Process(${ process . pid } ) SIGTERM, mf server will exit...`,
6162 ) ;
6263 this . _exit ( PROCESS_EXIT_CODE . SUCCESS ) ;
6364 } ) ;
6465
6566 process . on ( 'SIGINT' , ( ) => {
66- console . log (
67- chalk `{cyan ${ this . _options . name } Process(${ process . pid } ) SIGINT, mf server will exit...} `,
67+ logger . info (
68+ ` ${ this . _options . name } Process(${ process . pid } ) SIGINT, mf server will exit...`,
6869 ) ;
6970 this . _exit ( PROCESS_EXIT_CODE . SUCCESS ) ;
7071 } ) ;
7172 }
7273
7374 private _handleUnexpectedExit ( ) : void {
7475 process . on ( 'unhandledRejection' , ( error ) => {
75- console . error ( 'Unhandled Rejection Error: ' , error ) ;
76- console . log (
77- chalk `{cyan ${ this . _options . name } Process(${ process . pid } ) unhandledRejection, mf server will exit...} `,
76+ logger . error ( error ) ;
77+ logger . error (
78+ ` Process(${ process . pid } ) unhandledRejection, mf server will exit...`,
7879 ) ;
7980 this . _exit ( PROCESS_EXIT_CODE . FAILURE ) ;
8081 } ) ;
8182 process . on ( 'uncaughtException' , ( error ) => {
82- console . error ( 'Unhandled Rejection Error: ' , error ) ;
83- console . log (
84- chalk `{cyan ${ this . _options . name } Process(${ process . pid } ) uncaughtException, mf server will exit...} `,
83+ logger . error ( error ) ;
84+ logger . error (
85+ ` Process(${ process . pid } ) uncaughtException, mf server will exit...`,
8586 ) ;
8687 this . _exit ( PROCESS_EXIT_CODE . FAILURE ) ;
8788 } ) ;
0 commit comments