@dbml/cli 6.1.0 → 6.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,74 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _winston = require("winston");
8
- var _chalk = _interopRequireDefault(require("chalk"));
9
- var _path = _interopRequireDefault(require("path"));
10
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
- const {
12
- combine,
13
- timestamp,
14
- printf
15
- } = _winston.format;
16
- const consoleFormat = printf(info => {
17
- const {
18
- level,
19
- message
20
- } = info;
21
- return ` ${_chalk.default.red(level.toUpperCase())}: ${message}\n
22
- A complete log can be found in:
23
- ${_path.default.resolve(process.cwd(), 'dbml-error.log')}`;
24
- });
25
- const fileFormat = printf(info => {
26
- const {
27
- timestamp,
28
- stack,
29
- rootError
30
- } = info;
31
- let logContent = `${timestamp}\n${stack}\n`;
32
- if (rootError) {
33
- logContent += '\nROOT_ERROR:';
34
- logContent += `\n${rootError.stack}`;
35
- if (rootError.location) {
36
- logContent += `\n${JSON.stringify(rootError.location)}`;
37
- }
38
- logContent += '\n';
39
- }
40
- return logContent;
41
- });
42
- const consoleLogger = (0, _winston.createLogger)({
43
- format: combine(consoleFormat),
44
- transports: [new _winston.transports.Console({
45
- level: 'error'
46
- })]
47
- });
48
- const fileLogger = (0, _winston.createLogger)({
49
- format: combine(timestamp(), fileFormat),
50
- transports: [new _winston.transports.File({
51
- filename: 'dbml-error.log',
52
- level: 'error'
53
- })]
54
- });
55
- const logger = {
56
- debug(msg) {
57
- consoleLogger.debug(msg);
58
- },
59
- info(msg) {
60
- consoleLogger.info(msg);
61
- },
62
- warn(msg) {
63
- consoleLogger.warn(msg);
64
- },
65
- error(msg) {
66
- consoleLogger.error(msg);
67
- fileLogger.error(msg);
68
- },
69
- log(level, msg) {
70
- const lvl = exports[level];
71
- lvl(msg);
72
- }
73
- };
74
- var _default = exports.default = logger;