Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into unstable
Browse files Browse the repository at this point in the history
  • Loading branch information
nemchik authored Nov 7, 2023
2 parents d16c7b3 + 63fc42d commit b00aebd
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 39 deletions.
120 changes: 84 additions & 36 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"devDependencies": {
"@tsconfig/node-lts": "^18.12.5",
"husky": "^8.0.3",
"lint-staged": "^14.0.1",
"lint-staged": "^15.0.0",
"npm-package-json-lint": "^7.0.0",
"npm-package-json-lint-config-default": "^6.0.0",
"package-changed": "^3.0.0",
Expand All @@ -82,7 +82,7 @@
"xo": "^0.56.0"
},
"engines": {
"node": "18.x",
"node": "20.x",
"npm": "10.x"
}
}
13 changes: 12 additions & 1 deletion src/functions/logger.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
import { createLogger, format, transports } from 'winston';
import config from '../config.js';

const logLevels = {
error: 0,
warn: 1,
info: 2,
verbose: 3,
http: 4,
debug: 5,
silly: 6
};

export default createLogger({
levels: logLevels,
transports: [
new transports.File({
filename: 'error.log',
Expand All @@ -10,7 +21,7 @@ export default createLogger({
maxFiles: 5,
tailable: true,
format: format.combine(format.timestamp(), format.json()),
level: 'error',
level: 'error'
}),
new transports.File({
filename: 'combined.log',
Expand Down
4 changes: 4 additions & 0 deletions src/functions/startup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,8 @@ export default function startup() {
if (config.upPing && config.betterUptimeUrl.length === 0 && config.cronitorUrl.length === 0) {
throw new Error('CRITICAL ERROR: Betteruptime or Cronitor url is required when upPing is enabled');
}

if (config.webhooks && config.notifiarrApiUrl.length === 0) {
throw new Error('CRITICAL ERROR: Notifiarr API url is required when webhooks is enabled');
}
}

0 comments on commit b00aebd

Please sign in to comment.