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

property enabled | Node.js util module | Bun

property enabled | Node.js util module | BunBuildDocsReferenceGuidesBlogDiscord/node:util/DebugLogger/enabledPenabled

Search the reference...

/

BuildDocsReferenceGuidesBlogDiscord/node:util/DebugLogger/enabledPenabled

property

util.DebugLogger.enabledenabled: 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 →

property enabled | Node.js util module | Bun,AI智能索引,全网链接索引,智能导航,网页索引

    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`. ```js import { debuglog } from