Skip to content

Commit aaed0df

Browse files
committed
feat: logging
1 parent 74aaaba commit aaed0df

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

electron/main/app.ts

+6
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ app.setName('Phoenix');
1313
app.setAppUserModelId('com.github.dragonrealms-phoenix.phoenix');
1414

1515
const logger = createLogger('app');
16+
logger.info('welcome, brave adventurer!');
17+
logger.info('one moment while we prepare for your journey...');
1618

1719
const appEnv = process.env.APP_ENV ?? 'production';
1820
const appEnvIsProd = appEnv === 'production';
@@ -53,6 +55,8 @@ if (appEnvIsProd) {
5355
let ipcController: IpcController;
5456

5557
const createMainWindow = async (): Promise<void> => {
58+
logger.debug('creating main window');
59+
5660
if (appEnvIsDev) {
5761
// If running in development, serve the renderer from localhost.
5862
// This must be done once the app is ready.
@@ -114,8 +118,10 @@ const createMainWindow = async (): Promise<void> => {
114118

115119
// Prepare the renderer once the app is ready
116120
app.on('ready', () => {
121+
logger.info('electron is ready');
117122
runInBackground(async () => {
118123
if (appEnableDevTools) {
124+
logger.debug('installing chrome extension dev tools');
119125
const { installChromeExtensions } = await import(
120126
'./chrome/install-extension'
121127
);

electron/renderer/pages/grid.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ const GridPage: React.FC = (): ReactNode => {
271271
'game:connect',
272272
(_event: IpcRendererEvent, message: GameConnectMessage) => {
273273
const { accountName, characterName, gameCode } = message;
274-
logger.info('game:connect', {
274+
logger.debug('game:connect', {
275275
accountName,
276276
characterName,
277277
gameCode,
@@ -288,7 +288,7 @@ const GridPage: React.FC = (): ReactNode => {
288288
'game:disconnect',
289289
(_event: IpcRendererEvent, message: GameDisconnectMessage) => {
290290
const { accountName, characterName, gameCode } = message;
291-
logger.info('game:disconnect', {
291+
logger.debug('game:disconnect', {
292292
accountName,
293293
characterName,
294294
gameCode,

0 commit comments

Comments
 (0)