Skip to content

Commit

Permalink
feat: program és Node verzió beépítve error.log-ba
Browse files Browse the repository at this point in the history
  • Loading branch information
juzraai committed Jan 12, 2024
1 parent ff0bc58 commit c18ea7c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ assignees: juzraai
Ide másold be kérlek.
```

**Rendszerinformációk**
**(Ha nincs error.log fájl) Rendszerinformációk**

- Operációs rendszer: Windows? Linux?
- Node verzió (`node -v`): ?
Expand Down
11 changes: 7 additions & 4 deletions src/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,13 @@ export default class Logger {
'\nHa biztos vagy abban, hogy helyesen konfiguráltad a Díjnet Bot-ot, akkor a hiba a programban lehet.\nKérlek, az alábbi linken nyiss egy új issue-t, másold be a hiba részleteit, és írd le röviden, milyen szituációban jelentkezett a hiba!\n\n--> https://github.com/juzraai/dijnet-bot/issues\n\n';
this.log(s, kleur.red, true, false);
try {
fs.writeFileSync(
this.config.errorFile,
`${getTimestamp()}: ${error.message}\n${error.stack}`,
);
const lines = [
`Package: ${packageJson.name} v${packageJson.version}`,
`Platform: ${process.arch} ${process.platform} ${process.title} ${process.version}`,
`Timestamp: ${getTimestamp()}`,
error.stack || error,
];
fs.writeFileSync(this.config.errorFile, lines.join('\n'));
this.log(
`A hiba részleteit megtalálod a(z) ${this.config.errorFile} fájlban.`,
kleur.red,
Expand Down

0 comments on commit c18ea7c

Please sign in to comment.