(logFile?: string)
| 183 | * Sets up logging to the firebase-debug.log file. |
| 184 | */ |
| 185 | export function useFileLogger(logFile?: string): string { |
| 186 | const logFileName = logFile ?? findAvailableLogFile(); |
| 187 | logger.add( |
| 188 | new winston.transports.File({ |
| 189 | level: "debug", |
| 190 | filename: logFileName, |
| 191 | format: winston.format.printf((info) => { |
| 192 | const segments = [info.message, ...(info[SPLAT] || [])].map(tryStringify); |
| 193 | return `[${info.level}] ${stripVTControlCharacters(segments.join(" "))}`; |
| 194 | }), |
| 195 | }), |
| 196 | ); |
| 197 | return logFileName; |
| 198 | } |
| 199 | |
| 200 | /** |
| 201 | * Sets up logging to the command line. |
no test coverage detected
searching dependent graphs…