Skip to content

HCK-11191: Remove logging of system info #173

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 21, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 0 additions & 46 deletions reverse_engineering/helpers/logInfo.js
Original file line number Diff line number Diff line change
@@ -1,51 +1,5 @@
const os = require('os');
const packageFile = require('../../package.json');

const prefixZero = number => (number < 10 ? '0' + number : number);

const maxClock = cpus => {
return cpus.reduce((highestClock, cpu) => Math.max(highestClock, cpu.speed), 0);
};

const toTime = number => {
return Math.floor(number / 3600) + ':' + prefixZero(parseInt((number / 3600 - Math.floor(number / 3600)) * 60));
};

const getPluginVersion = () => packageFile.version;

const getSystemInfo = appVersion => {
return (
'' +
`Date: ${new Date()}` +
'\n' +
`Application version: ${appVersion}` +
'\n' +
`Plugin version: ${getPluginVersion()}` +
'\n\n' +
`System information:` +
'\n' +
` Hostname: ${os.hostname()}` +
'\n' +
` Platform: ${os.platform()} ${os.arch()}` +
'\n' +
` Release: ${os.release()}` +
'\n' +
` Uptime: ${toTime(os.uptime())}` +
'\n' +
` Total RAM: ${(os.totalmem() / 1073741824).toFixed(2)} GB` +
'\n' +
` CPU Model: ${os.cpus()[0].model}` +
'\n' +
` CPU Clock: ${maxClock(os.cpus())} MHZ` +
'\n' +
` CPU Cores: ${os.cpus().length} cores` +
'\n\n'
);
};

const logInfo = (step, connectionInfo, logger) => {
logger.clear();
logger.log('info', getSystemInfo(connectionInfo.appVersion), step);
logger.log('info', connectionInfo, 'connectionInfo', connectionInfo.hiddenKeys);
};

Expand Down