File tree Expand file tree Collapse file tree 3 files changed +12
-2
lines changed
Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 11import type { Config } from "../../config/index.js" ;
22import { DI } from "../../di.js" ;
3+ import type { ILogger } from "../../log/index.js" ;
4+ import { Logger } from "../../log/index.js" ;
35import { json_stringify } from "../../utils/bigint-serializer.js" ;
46import type { OptimisticResults } from "../liquidate/index.js" ;
57
68export default class BaseWriter {
9+ @Logger ( "OutputWriter" )
10+ log ! : ILogger ;
11+
712 @DI . Inject ( DI . Config )
813 config ! : Config ;
914
Original file line number Diff line number Diff line change @@ -11,9 +11,10 @@ export default class FileWriter
1111 public async write ( ) : Promise < void > {
1212 const filename = join ( this . config . outDir , this . filename ) ;
1313 try {
14+ this . log . debug ( `writing to ${ filename } ` ) ;
1415 await writeFile ( filename , this . content , "utf-8" ) ;
1516 } catch ( e ) {
16- console . error ( e ) ;
17+ this . log . error ( e , `failed to write to ${ filename } ` ) ;
1718 }
1819 }
1920}
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ export default class S3Writer
1313 const key = join ( this . config . outS3Prefix , this . filename ) ;
1414 const client = new S3Client ( { } ) ;
1515 try {
16+ this . log . debug ( `uploading to s3://${ this . config . outS3Bucket } /${ key } ` ) ;
1617 await client . send (
1718 new PutObjectCommand ( {
1819 Bucket : this . config . outS3Bucket ,
@@ -22,7 +23,10 @@ export default class S3Writer
2223 } ) ,
2324 ) ;
2425 } catch ( e ) {
25- console . error ( e ) ;
26+ this . log . error (
27+ e ,
28+ `failed to upload to s3://${ this . config . outS3Bucket } /${ key } ` ,
29+ ) ;
2630 }
2731 }
2832}
You can’t perform that action at this time.
0 commit comments