Skip to content

Commit

Permalink
add debug logs
Browse files Browse the repository at this point in the history
  • Loading branch information
koji committed Jan 4, 2024
1 parent 92332bd commit 3d882da
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app-shell-odd/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,17 +99,21 @@ function startUp(): void {
]

ipcMain.on('dispatch', (_, action) => {
log.info('on: dispatch')
log.debug('Received action via IPC from renderer', { action })
actionHandlers.forEach(handler => handler(action))
log.info('after forEach')
})

log.silly('Global references', { mainWindow, rendererLogger })

ipcMain.once('dispatch', () => {
log.info('systemd dispatch start')
systemd.sendStatus('started')
systemd.ready()
const stopWatching = watchForMassStorage(dispatch)
ipcMain.once('quit', stopWatching)
log.info('systemd dispatch end')
})
}

Expand Down
1 change: 1 addition & 0 deletions app-shell-odd/src/restart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ let _log: Logger | undefined
const log = (): Logger => _log ?? (_log = createLogger('config'))

export function registerAppRestart(): (action: Action) => unknown {
log().info('registerAppRestart')
return function handleAction(action: Action) {
switch (action.type) {
case APP_RESTART:
Expand Down
1 change: 1 addition & 0 deletions app-shell-odd/src/system-update/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export function registerRobotSystemUpdate(dispatch: Dispatch): Dispatch {
case 'shell:CHECK_UPDATE':
updateLatestVersion()
.then(() => {
log.info('right after updateLatestVersion')
if (isUpdateAvailable() && !isGettingLatestSystemFiles) {
isGettingLatestSystemFiles = true
log.info('before getLatestSystemUpdateFiles')
Expand Down
2 changes: 2 additions & 0 deletions app-shell-odd/src/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export const updateLatestVersion = (): Promise<string> => {
`Update: latest version available from ${FLEX_MANIFEST_URL} is ${latestAvailableVersion}`
)
}
log.info('before return version')
return LATEST_OT_SYSTEM_VERSION
})
.catch((e: Error) => {
Expand Down Expand Up @@ -97,6 +98,7 @@ export function registerUpdate(
}

export function registerUpdateBrightness(): (action: Action) => unknown {
log.info('registerUpdateBrightness')
return function handleAction(action: Action) {
switch (action.type) {
case UPDATE_BRIGHTNESS:
Expand Down

0 comments on commit 3d882da

Please sign in to comment.