@orxataguy/tyr 1.0.45 → 1.0.47

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orxataguy/tyr",
3
- "version": "1.0.45",
3
+ "version": "1.0.47",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "tyr": "./bin/tyr.js"
@@ -41,6 +41,7 @@ export class Kernel {
41
41
  private config: TyrConfig | null;
42
42
  private frameworkRoot: string;
43
43
  private userRoot: string;
44
+ private isDebug: boolean = false;
44
45
 
45
46
  constructor() {
46
47
  this.container = new Container();
@@ -52,6 +53,10 @@ export class Kernel {
52
53
  public async boot(args: string[]): Promise<void> {
53
54
  const isDebug = args.includes('--debug');
54
55
 
56
+ if (isDebug) {
57
+ args.splice(args.indexOf('--debug'), 1);
58
+ }
59
+
55
60
  (dotenv as any).config({ path: path.join(this.userRoot, '.env'), quiet: true });
56
61
 
57
62
  await this.container.init(isDebug);
@@ -55,11 +55,11 @@ export function createLogger(isDebug: boolean): Logger {
55
55
  writeToFile('SUCCESS', msg);
56
56
  },
57
57
  error: (msg) => {
58
- if (isDebug) console.error(chalk.red('✖'), msg);
58
+ console.error(chalk.red('✖'), msg);
59
59
  writeToFile('ERROR', msg);
60
60
  },
61
61
  warn: (msg) => {
62
- if (isDebug) console.warn(chalk.yellow('⚠'), msg);
62
+ console.warn(chalk.yellow('⚠'), msg);
63
63
  writeToFile('WARN', msg);
64
64
  },
65
65
  };
@@ -34,7 +34,7 @@ export class TyrError extends Error {
34
34
  logger.error('Oops! An error occurred.');
35
35
  logger.error(`↳ ${this.message}`);
36
36
 
37
- if (this.originalError) {
37
+ if (this.originalError && isDebug) {
38
38
  logger.error(` ↳ Caused by: ${this.extractErrorMessage(this.originalError)}`);
39
39
  }
40
40