MCPcopy
hub / github.com/vitejs/vite / output

Function output

packages/vite/src/node/logger.ts:104–132  ·  view source on GitHub ↗
(type: LogType, msg: string, options: LogErrorOptions = {})

Source from the content-addressed store, hash-verified

102 }
103
104 function output(type: LogType, msg: string, options: LogErrorOptions = {}) {
105 if (thresh >= LogLevels[type]) {
106 const method = type === 'info' ? 'log' : type
107
108 if (options.error) {
109 loggedErrors.add(options.error)
110 }
111 if (canClearScreen) {
112 if (type === lastType && msg === lastMsg) {
113 sameCount++
114 clear()
115 console[method](
116 format(type, msg, options),
117 colors.yellow(`(x${sameCount + 1})`),
118 )
119 } else {
120 sameCount = 0
121 lastMsg = msg
122 lastType = type
123 if (options.clear) {
124 clear()
125 }
126 console[method](format(type, msg, options))
127 }
128 } else {
129 console[method](format(type, msg, options))
130 }
131 }
132 }
133
134 const warnedMessages = new Set<string>()
135

Callers 4

infoFunction · 0.85
warnFunction · 0.85
warnOnceFunction · 0.85
errorFunction · 0.85

Calls 2

formatFunction · 0.85
addMethod · 0.80

Tested by

no test coverage detected