File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed
Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ export interface LoggerOptions {
5151 allowClearScreen ?: boolean
5252 customLogger ?: Logger
5353 console ?: Console
54+ defaultLogOptions ?: LogOptions
5455}
5556
5657// Only initialize the timeFormatter when the timestamp option is used, and
@@ -78,13 +79,15 @@ export function createLogger(
7879 prefix = '[vite]' ,
7980 allowClearScreen = true ,
8081 console = globalThis . console ,
82+ defaultLogOptions = { }
8183 } = options
8284 const thresh = LogLevels [ level ]
8385 const canClearScreen =
8486 allowClearScreen && process . stdout . isTTY && ! process . env . CI
8587 const clear = canClearScreen ? clearScreen : ( ) => { }
8688
8789 function format ( type : LogType , msg : string , options : LogErrorOptions = { } ) {
90+ options = Object . assign ( defaultLogOptions , options )
8891 if ( options . timestamp ) {
8992 let tag = ''
9093 if ( type === 'info' ) {
You can’t perform that action at this time.
0 commit comments