Skip to content

Commit dd8f858

Browse files
committed
feat: add logs
1 parent 2b6857b commit dd8f858

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

app/main.dev.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,17 @@ import type { BrowserViewName } from './reducers/electron';
1818
import getRandomUserAgent from './utils/randomUserAgent';
1919
import electronObjects from './store/electronObjects';
2020
import resizeViews from './utils/resizeViews';
21+
import { version, osData } from './utils/info';
22+
23+
logger.info(`Running version ${version}`);
24+
logger.info(`Running on:`, osData);
2125

2226
const isProduction = process.env.NODE_ENV === 'production';
2327
const isDevelopment = process.env.NODE_ENV === 'development';
2428
const enableDebug = process.env.ENABLE_DEBUG === 'true';
2529
const enableDevtools = isDevelopment || enableDebug;
2630
logger.info(
27-
`ENVIRONMENT prod:${isProduction} dev:${isDevelopment} debug:${enableDebug} tools:${enableDevtools}`
31+
`ENV prod:${isProduction} dev:${isDevelopment} debug:${enableDebug} tools:${enableDevtools}`
2832
);
2933

3034
let isLaunching = true;

app/reducers/cache.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
RESET_CACHE,
66
SET_CACHE
77
} from '../constants/actionTypes';
8+
import { logger } from '../utils/tracer-logger.js';
89

910
export type BaseCacheEntry = {
1011
timestamp: number;
@@ -38,6 +39,9 @@ export default function cache(
3839
action: Action
3940
): cacheStateType {
4041
if (action.type === MARK_COMPLETED) {
42+
logger.info(
43+
`Mark application for flat ${flatId} as completed. [success=${data.success}]`
44+
);
4145
const { name, identifier, data } = action.payload;
4246
return dotProp.set(state, `${name}.${identifier}`, {
4347
...data,

app/utils/info.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import os from 'node:os';
2+
import { version as v } from '../../package.json';
3+
4+
export const version = v;
5+
6+
export const osData = {
7+
platform: os.platform(),
8+
release: os.release(),
9+
machine: os.machine(),
10+
architecture: os.arch(),
11+
version: os.version(),
12+
memory: os.totalmem(),
13+
freeMemory: os.freemem(),
14+
cpus: os.cpus().length
15+
};

0 commit comments

Comments
 (0)