File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 119119 "chokidar" : " ^5.0.0" ,
120120 "cmdk" : " ^1.1.1" ,
121121 "date-fns" : " ^3.3.1" ,
122+ "electron-log" : " ^5.4.3" ,
122123 "electron-store" : " ^11.0.0" ,
123124 "idb-keyval" : " ^6.2.2" ,
124125 "node-addon-api" : " ^8.5.0" ,
Original file line number Diff line number Diff line change 11import path from "node:path" ;
2+ import { type FSWatcher , watch } from "chokidar" ;
23import { app } from "electron" ;
3- import { watch , type FSWatcher } from "chokidar" ;
4+ import { logger } from "../lib/logger" ;
5+
6+ const log = logger . scope ( "dev-reload" ) ;
47
58let watcher : FSWatcher | null = null ;
69
@@ -10,7 +13,7 @@ export function setupAgentHotReload(): void {
1013 const monorepoRoot = path . resolve ( app . getAppPath ( ) , "../.." ) ;
1114 const agentDistPath = path . join ( monorepoRoot , "packages/agent/dist" ) ;
1215
13- console . log ( `[dev] Watching agent package: ${ agentDistPath } `) ;
16+ log . info ( ` Watching agent package: ${ agentDistPath } `) ;
1417
1518 let debounceTimeout : NodeJS . Timeout | null = null ;
1619
@@ -22,8 +25,8 @@ export function setupAgentHotReload(): void {
2225 watcher . on ( "change" , ( filePath ) => {
2326 if ( debounceTimeout ) clearTimeout ( debounceTimeout ) ;
2427 debounceTimeout = setTimeout ( ( ) => {
25- console . log ( `[dev] Agent rebuilt: ${ path . basename ( filePath ) } `) ;
26- console . log ( "[dev] Exiting for mprocs to restart...") ;
28+ log . info ( ` Agent rebuilt: ${ path . basename ( filePath ) } `) ;
29+ log . info ( " Exiting for mprocs to restart...") ;
2730 process . exit ( 0 ) ;
2831 } , 1000 ) ;
2932 } ) ;
You can’t perform that action at this time.
0 commit comments