Skip to content

Commit

Permalink
More debug logs
Browse files Browse the repository at this point in the history
  • Loading branch information
alanhamlett committed Dec 17, 2024
1 parent ca75ae3 commit a63de84
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions electron/watchers/watcher.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import type { IGlobalKeyListener } from "node-global-key-listener";
import {
WindowInfo,
activeWindow,
subscribeActiveWindow,
unsubscribeActiveWindow,
WindowInfo,
} from "@miniben90/x-win";
import { GlobalKeyboardListener } from "node-global-key-listener";

import { AppsManager } from "../helpers/apps-manager";
import { GlobalKeyboardListener } from "node-global-key-listener";
import type { IGlobalKeyListener } from "node-global-key-listener";
import { Logging } from "../utils/logging";
import { MonitoredApp } from "../helpers/monitored-app";
import { MonitoringManager } from "../helpers/monitoring-manager";
import { Logging, LogLevel } from "../utils/logging";
import { Wakatime } from "./wakatime";

export class Watcher {
Expand Down Expand Up @@ -79,6 +79,7 @@ export class Watcher {

Logging.instance().log(
`App changed from ${this.activeWindow?.info.name || "nil"} to ${windowInfo.info.name}`,
LogLevel.DEBUG,
);

this.activeWindow = windowInfo;
Expand All @@ -88,7 +89,16 @@ export class Watcher {
);

if (isMonitored) {
Logging.instance().log(
`Monitoring ${windowInfo.info.name}: ${this.activeWindow.info.path}`,
LogLevel.DEBUG,
);
this.watchKeyboardEvents();
} else {
Logging.instance().log(
`Not monitoring ${windowInfo.info.name}: ${this.activeWindow.info.path}`,
LogLevel.DEBUG,
);
}
}
},
Expand Down

0 comments on commit a63de84

Please sign in to comment.