@@ -10,6 +10,7 @@ import {
10
10
WEB_CLIENT_OPTIONS_IDENTIFIER ,
11
11
WebClientOptions ,
12
12
getIPV4 ,
13
+ logger ,
13
14
} from '../server' ;
14
15
import type { Compiler , WebpackPluginInstance } from 'webpack' ;
15
16
import path from 'path' ;
@@ -56,32 +57,32 @@ export class DevPlugin implements WebpackPluginInstance {
56
57
57
58
private _stopWhenSIGTERMOrSIGINT ( ) : void {
58
59
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...`,
61
62
) ;
62
63
this . _exit ( PROCESS_EXIT_CODE . SUCCESS ) ;
63
64
} ) ;
64
65
65
66
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...`,
68
69
) ;
69
70
this . _exit ( PROCESS_EXIT_CODE . SUCCESS ) ;
70
71
} ) ;
71
72
}
72
73
73
74
private _handleUnexpectedExit ( ) : void {
74
75
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...`,
78
79
) ;
79
80
this . _exit ( PROCESS_EXIT_CODE . FAILURE ) ;
80
81
} ) ;
81
82
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...`,
85
86
) ;
86
87
this . _exit ( PROCESS_EXIT_CODE . FAILURE ) ;
87
88
} ) ;
0 commit comments