温馨提示:本站仅提供公开网络链接索引服务,不存储、不篡改任何第三方内容,所有内容版权归原作者所有
AI智能索引来源:http://www.bun.com/reference/node/util/DebugLogger
点击访问原文链接

Node util.DebugLogger TypeScript interface | API Reference | Bun

Node util.DebugLogger TypeScript interface | API Reference | BunBuildDocsReferenceGuidesBlogDiscord/node:util/DebugLoggerPenabled

Search the reference...

/

BuildDocsReferenceGuidesBlogDiscord/node:util/DebugLoggerPenabled

interface

util.DebugLoggerinterface DebugLoggerenabled: boolean

The util.debuglog().enabled getter is used to create a test that can be used in conditionals based on the existence of the NODE_DEBUG environment variable. If the section name appears within the value of that environment variable, then the returned value will be true. If not, then the returned value will be false.

import { debuglog } from 'node:util';
const enabled = debuglog('foo').enabled;
if (enabled) {
console.log('hello from foo [%d]', 123);
}

If this program is run with NODE_DEBUG=foo in the environment, then it will output something like:

hello from foo [123]

Resources

ReferenceDocsGuidesDiscordMerch StoreGitHubBlog 

Toolkit

RuntimePackage managerTest runnerBundlerPackage runner

Project

Bun 1.0Bun 1.1Bun 1.2Bun 1.3RoadmapContributingLicense

Baked with ❤️ in San Francisco

We're hiring →

Node util.DebugLogger TypeScript interface | API Reference | Bun,AI智能索引,全网链接索引,智能导航,网页索引

    API documentation for interface node:util.DebugLogger | Bun