diff options
author | Chocobozzz <me@florianbigard.com> | 2021-03-09 09:22:05 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-03-24 18:18:40 +0100 |
commit | 18b24b2dc5a21007f62b2e625d50b1f4b7dec784 (patch) | |
tree | 11327be380e5fef0795358b189be68aa5d78924b /server/middlewares/validators/jobs.ts | |
parent | db4b15f21fbf4e33434e930ffc7fb768cdcf9d42 (diff) | |
download | PeerTube-18b24b2dc5a21007f62b2e625d50b1f4b7dec784.tar.gz PeerTube-18b24b2dc5a21007f62b2e625d50b1f4b7dec784.tar.zst PeerTube-18b24b2dc5a21007f62b2e625d50b1f4b7dec784.zip |
Add jobs tag to logger
Diffstat (limited to 'server/middlewares/validators/jobs.ts')
-rw-r--r-- | server/middlewares/validators/jobs.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/server/middlewares/validators/jobs.ts b/server/middlewares/validators/jobs.ts index 99ef25e0a..d87b28c06 100644 --- a/server/middlewares/validators/jobs.ts +++ b/server/middlewares/validators/jobs.ts | |||
@@ -1,9 +1,11 @@ | |||
1 | import * as express from 'express' | 1 | import * as express from 'express' |
2 | import { param, query } from 'express-validator' | 2 | import { param, query } from 'express-validator' |
3 | import { isValidJobState, isValidJobType } from '../../helpers/custom-validators/jobs' | 3 | import { isValidJobState, isValidJobType } from '../../helpers/custom-validators/jobs' |
4 | import { logger } from '../../helpers/logger' | 4 | import { logger, loggerTagsFactory } from '../../helpers/logger' |
5 | import { areValidationErrors } from './utils' | 5 | import { areValidationErrors } from './utils' |
6 | 6 | ||
7 | const lTags = loggerTagsFactory('validators', 'jobs') | ||
8 | |||
7 | const listJobsValidator = [ | 9 | const listJobsValidator = [ |
8 | param('state') | 10 | param('state') |
9 | .optional() | 11 | .optional() |
@@ -14,7 +16,7 @@ const listJobsValidator = [ | |||
14 | .custom(isValidJobType).withMessage('Should have a valid job state'), | 16 | .custom(isValidJobType).withMessage('Should have a valid job state'), |
15 | 17 | ||
16 | (req: express.Request, res: express.Response, next: express.NextFunction) => { | 18 | (req: express.Request, res: express.Response, next: express.NextFunction) => { |
17 | logger.debug('Checking listJobsValidator parameters.', { parameters: req.params }) | 19 | logger.debug('Checking listJobsValidator parameters.', { parameters: req.params, ...lTags() }) |
18 | 20 | ||
19 | if (areValidationErrors(req, res)) return | 21 | if (areValidationErrors(req, res)) return |
20 | 22 | ||