Spaces:
Configuration error
Configuration error
Download src/shared/logging/runtime-logging.ts from pirzm1/video-generator: direct link, hf CLI and curl.
- Browser
- Download file 990 Bytes
-
https://huggingface.co/spaces/pirzm1/video-generator/resolve/main/src/shared/logging/runtime-logging.ts
- Command line
-
hf download hf://spaces/pirzm1/video-generator/src/shared/logging/runtime-logging.ts
-
curl -L -o runtime-logging.ts https://huggingface.co/spaces/pirzm1/video-generator/resolve/main/src/shared/logging/runtime-logging.ts
990 Bytes
| import { format } from 'util'; | |
| import { inMcpRuntime } from '../runtime/paths'; | |
| function writeLine(stream: NodeJS.WriteStream, message: string): void { | |
| stream.write(`${message}\n`); | |
| } | |
| function formatMessage(args: unknown[]): string { | |
| return format(...args); | |
| } | |
| export function logInfo(...args: unknown[]): void { | |
| const message = formatMessage(args); | |
| if (inMcpRuntime()) { | |
| writeLine(process.stderr, message); | |
| return; | |
| } | |
| console.log(message); | |
| } | |
| export function logWarn(...args: unknown[]): void { | |
| const message = formatMessage(args); | |
| if (inMcpRuntime()) { | |
| writeLine(process.stderr, message); | |
| return; | |
| } | |
| console.warn(message); | |
| } | |
| export function logError(...args: unknown[]): void { | |
| writeLine(process.stderr, formatMessage(args)); | |
| } | |
| export function writeProgress(message: string): void { | |
| if (inMcpRuntime()) { | |
| process.stderr.write(message); | |
| return; | |
| } | |
| process.stdout.write(message); | |
| } | |