mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-08 21:07:46 +00:00
This PR adds `VERCEL_DEBUG_PREFIX` environment variable which lets you set a prefix for the debug logs.
10 lines
341 B
TypeScript
10 lines
341 B
TypeScript
import { getPlatformEnv } from './get-platform-env';
|
|
|
|
export default function debug(message: string, ...additional: any[]) {
|
|
if (getPlatformEnv('BUILDER_DEBUG')) {
|
|
console.log(message, ...additional);
|
|
} else if (process.env.VERCEL_DEBUG_PREFIX) {
|
|
console.log(`${process.env.VERCEL_DEBUG_PREFIX}${message}`, ...additional);
|
|
}
|
|
}
|