MCPcopy Create free account
hub / github.com/Easy-Editor/EasyEditor / getLogArgs

Function getLogArgs

packages/core/src/utils/logger.ts:110–126  ·  view source on GitHub ↗
(args: any, bizName: string, logLevel: string)

Source from the content-addressed store, hash-verified

108}
109
110const getLogArgs = (args: any, bizName: string, logLevel: string) => {
111 const color = getColor(bizName)
112 const bodyColor = bodyColors[logLevel]
113
114 const argsArray = args[0]
115 let prefix = `%c[${bizName}]%c[${levelMarks[logLevel]}]:`
116 argsArray.forEach((arg: any) => {
117 if (isObject(arg)) {
118 prefix += '%o'
119 } else {
120 prefix += '%s'
121 }
122 })
123 let processedArgs = [prefix, `color: ${color}`, `color: ${bodyColor}`]
124 processedArgs = processedArgs.concat(argsArray)
125 return processedArgs
126}
127
128const parseLogConf = (logConf: string, options: Options): { level: string; bizName: string } => {
129 if (!logConf) {

Callers 1

outputFunction · 0.85

Calls 3

isObjectFunction · 0.90
getColorFunction · 0.85
forEachMethod · 0.45

Tested by

no test coverage detected