@cyclonedx/cyclonedx-esbuild
Version:
Creates CycloneDX Software Bill of Materials (SBoM) from esbuild projects
46 lines (41 loc) • 1.47 kB
JavaScript
;
/*!
This file is part of CycloneDX generator for esbuild.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
SPDX-License-Identifier: Apache-2.0
Copyright (c) OWASP Foundation. All Rights Reserved.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.LogPrefixes = void 0;
exports.makeConsoleLogger = makeConsoleLogger;
function noop() {
}
var LogPrefixes;
(function (LogPrefixes) {
LogPrefixes["DEBUG"] = "DEBUG |";
LogPrefixes["INFO"] = "INFO |";
LogPrefixes["LOG"] = "LOG |";
LogPrefixes["WARN"] = "WARN |";
LogPrefixes["ERROR"] = "ERROR |";
})(LogPrefixes || (exports.LogPrefixes = LogPrefixes = {}));
function makeConsoleLogger(out, err, level) {
const myConsole = new console.Console(out, err);
if (level < 3) {
myConsole.debug = noop;
if (level < 2) {
myConsole.info = noop;
if (level < 1) {
myConsole.log = noop;
}
}
}
return myConsole;
}