File tree Expand file tree Collapse file tree 5 files changed +10
-5
lines changed
Expand file tree Collapse file tree 5 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import { publicGenerators } from '../../src/generators/index.mjs';
1111import createGenerator from '../../src/generators.mjs' ;
1212import createLinter from '../../src/linter/index.mjs' ;
1313import { getEnabledRules } from '../../src/linter/utils/rules.mjs' ;
14+ import { Logger } from '../../src/logger/index.mjs' ;
1415import { parseChangelog , parseIndex } from '../../src/parsers/markdown.mjs' ;
1516import { loadAndParse } from '../utils.mjs' ;
1617
@@ -139,7 +140,7 @@ export default {
139140 linter ?. report ( ) ;
140141
141142 if ( linter ?. hasError ( ) ) {
142- console . error ( 'Lint failed; aborting generation.' ) ;
143+ Logger . getInstance ( ) . error ( 'Lint failed; aborting generation.' ) ;
143144 process . exit ( 1 ) ;
144145 }
145146
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import {
1313} from '@clack/prompts' ;
1414
1515import commands from './index.mjs' ;
16+ import { Logger } from '../../src/logger/index.mjs' ;
1617
1718/**
1819 * Validates that a string is not empty.
@@ -165,7 +166,7 @@ export default async function interactive() {
165166
166167 const finalCommand = cmdParts . join ( ' ' ) ;
167168
168- console . log ( `\nGenerated command:\n${ finalCommand } \n` ) ;
169+ Logger . getInstance ( ) . info ( `\nGenerated command:\n${ finalCommand } \n` ) ;
169170
170171 // Step 5: Confirm and execute the generated command
171172 if ( await confirm ( { message : 'Run now?' , initialValue : true } ) ) {
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import createLinter from '../../src/linter/index.mjs';
44import reporters from '../../src/linter/reporters/index.mjs' ;
55import rules from '../../src/linter/rules/index.mjs' ;
66import { getEnabledRules } from '../../src/linter/utils/rules.mjs' ;
7+ import { Logger } from '../../src/logger/index.mjs' ;
78import { loadAndParse } from '../utils.mjs' ;
89
910const availableRules = Object . keys ( rules ) ;
@@ -89,7 +90,7 @@ export default {
8990
9091 process . exitCode = + linter . hasError ( ) ;
9192 } catch ( error ) {
92- console . error ( 'Error running the linter:' , error ) ;
93+ Logger . getInstance ( ) . error ( 'Error running the linter:' , error ) ;
9394 process . exitCode = 1 ;
9495 }
9596 } ,
Original file line number Diff line number Diff line change 11import { publicGenerators } from '../../src/generators/index.mjs' ;
22import reporters from '../../src/linter/reporters/index.mjs' ;
33import rules from '../../src/linter/rules/index.mjs' ;
4+ import { Logger } from '../../src/logger/index.mjs' ;
45
56const availableRules = Object . keys ( rules ) ;
67const availableReporters = Object . keys ( reporters ) ;
@@ -23,5 +24,5 @@ export default function list(type) {
2324 ? availableRules
2425 : availableReporters ;
2526
26- console . log ( list . join ( '\n' ) ) ;
27+ Logger . getInstance ( ) . info ( list . join ( '\n' ) ) ;
2728}
Original file line number Diff line number Diff line change 11import createMarkdownLoader from '../src/loaders/markdown.mjs' ;
2+ import { Logger } from '../src/logger/index.mjs' ;
23import createMarkdownParser from '../src/parsers/markdown.mjs' ;
34
45/**
@@ -43,7 +44,7 @@ export const errorWrap =
4344 try {
4445 return await fn ( ...args ) ;
4546 } catch ( err ) {
46- console . error ( err ) ;
47+ Logger . getInstance ( ) . error ( err ) ;
4748 process . exit ( 1 ) ;
4849 }
4950 } ;
You can’t perform that action at this time.
0 commit comments