UNPKG

1.57 kBJavaScriptView Raw
1
2 import {createRequire as __cjsCompatRequire} from 'module';
3 const require = __cjsCompatRequire(import.meta.url);
4 const __ESM_IMPORT_META_URL__ = import.meta.url;
5
6// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/logging/src/logger.mjs
7var LogLevel;
8(function(LogLevel2) {
9 LogLevel2[LogLevel2["debug"] = 0] = "debug";
10 LogLevel2[LogLevel2["info"] = 1] = "info";
11 LogLevel2[LogLevel2["warn"] = 2] = "warn";
12 LogLevel2[LogLevel2["error"] = 3] = "error";
13})(LogLevel || (LogLevel = {}));
14
15// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/logging/src/console_logger.mjs
16var RESET = "\x1B[0m";
17var RED = "\x1B[31m";
18var YELLOW = "\x1B[33m";
19var BLUE = "\x1B[36m";
20var DEBUG = `${BLUE}Debug:${RESET}`;
21var WARN = `${YELLOW}Warning:${RESET}`;
22var ERROR = `${RED}Error:${RESET}`;
23var ConsoleLogger = class {
24 constructor(level) {
25 this.level = level;
26 }
27 debug(...args) {
28 if (this.level <= LogLevel.debug)
29 console.debug(DEBUG, ...args);
30 }
31 info(...args) {
32 if (this.level <= LogLevel.info)
33 console.info(...args);
34 }
35 warn(...args) {
36 if (this.level <= LogLevel.warn)
37 console.warn(WARN, ...args);
38 }
39 error(...args) {
40 if (this.level <= LogLevel.error)
41 console.error(ERROR, ...args);
42 }
43};
44
45export {
46 LogLevel,
47 ConsoleLogger
48};
49/**
50 * @license
51 * Copyright Google LLC All Rights Reserved.
52 *
53 * Use of this source code is governed by an MIT-style license that can be
54 * found in the LICENSE file at https://angular.io/license
55 */
56//# sourceMappingURL=chunk-LX5Q27EF.js.map