44/* eslint-disable no-console */
55import * as fs from 'fs' ;
66import * as path from 'path' ;
7+ import { Logger } from '../logger' ;
78
89export class fileutil {
910 public static readFilesSync ( dir : string ) : File [ ] {
@@ -67,7 +68,7 @@ export class fileutil {
6768 public static saveToFile ( outputFilePath : string , modifiedHtml : string ) : void {
6869 try {
6970 fs . writeFileSync ( outputFilePath , modifiedHtml ) ;
70- console . log ( `Modified HTML saved to ${ outputFilePath } ` ) ;
71+ Logger . logger . info ( `Modified HTML saved to ${ outputFilePath } ` ) ;
7172 } catch ( error ) {
7273 console . error ( `Error writing file to disk: ${ error } ` ) ;
7374 throw error ;
@@ -85,14 +86,14 @@ export class fileutil {
8586 } ) ;
8687
8788 for ( const subDirectory of subDirectories ) {
88- console . log ( `Processing subdirectory: ${ subDirectory } ` ) ;
89+ Logger . logger . info ( `Processing subdirectory: ${ subDirectory } ` ) ;
8990 const subDirPath = path . join ( baseDir , subDirectory ) ;
9091
9192 // Check the XML file for the substring
9293 const xmlFilePath = path . join ( subDirPath , `${ subDirectory } .js-meta.xml` ) ;
9394 if ( fs . existsSync ( xmlFilePath ) ) {
9495 if ( this . doesSubstringExist ( xmlFilePath , searchString ) ) {
95- console . log ( `Substring found in ${ xmlFilePath } . Skipping all files in ${ subDirectory } .` ) ;
96+ Logger . logger . info ( `Substring found in ${ xmlFilePath } . Skipping all files in ${ subDirectory } .` ) ;
9697 continue ; // Move to the next subdirectory
9798 }
9899 }
@@ -104,7 +105,7 @@ export class fileutil {
104105 . filter ( ( file ) => file . endsWith ( '.html' ) || file . endsWith ( '.js' ) || file . endsWith ( '.xml' ) ) ;
105106 files . forEach ( ( file ) => {
106107 const filePath = path . join ( subDirPath , file ) ;
107- console . log ( `Processing file: ${ filePath } ` ) ;
108+ Logger . logger . info ( `Processing file: ${ filePath } ` ) ;
108109 const name = path . parse ( file ) . name ;
109110 const ext = path . parse ( file ) . ext ;
110111 const filepath = path . resolve ( subDirPath , file ) ;
0 commit comments