1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 10:49:28 +02:00

Remove unnecessary logs

This commit is contained in:
Chocobozzz 2022-08-17 14:58:40 +02:00
parent 2ec349aa85
commit a85d530384
No known key found for this signature in database
GPG key ID: 583A612D890159BE
45 changed files with 46 additions and 352 deletions

View file

@ -5,7 +5,6 @@ import { PluginType } from '../../../shared/models/plugins/plugin.type'
import { InstallOrUpdatePlugin } from '../../../shared/models/plugins/server/api/install-plugin.model'
import { exists, isBooleanValid, isSafePath, toBooleanOrNull, toIntOrNull } from '../../helpers/custom-validators/misc'
import { isNpmPluginNameValid, isPluginNameValid, isPluginTypeValid, isPluginVersionValid } from '../../helpers/custom-validators/plugins'
import { logger } from '../../helpers/logger'
import { CONFIG } from '../../initializers/config'
import { PluginManager } from '../../lib/plugins/plugin-manager'
import { PluginModel } from '../../models/server/plugin'
@ -26,8 +25,6 @@ const getPluginValidator = (pluginType: PluginType, withVersion = true) => {
return validators.concat([
(req: express.Request, res: express.Response, next: express.NextFunction) => {
logger.debug('Checking getPluginValidator parameters', { parameters: req.params })
if (areValidationErrors(req, res)) return
const npmName = PluginModel.buildNpmName(req.params.pluginName, pluginType)
@ -58,8 +55,6 @@ const getExternalAuthValidator = [
.custom(exists),
(req: express.Request, res: express.Response, next: express.NextFunction) => {
logger.debug('Checking getExternalAuthValidator parameters', { parameters: req.params })
if (areValidationErrors(req, res)) return
const plugin = res.locals.registeredPlugin
@ -89,8 +84,6 @@ const pluginStaticDirectoryValidator = [
.custom(isSafePath),
(req: express.Request, res: express.Response, next: express.NextFunction) => {
logger.debug('Checking pluginStaticDirectoryValidator parameters', { parameters: req.params })
if (areValidationErrors(req, res)) return
return next()
@ -108,8 +101,6 @@ const listPluginsValidator = [
.custom(isBooleanValid),
(req: express.Request, res: express.Response, next: express.NextFunction) => {
logger.debug('Checking listPluginsValidator parameters', { parameters: req.query })
if (areValidationErrors(req, res)) return
return next()
@ -128,8 +119,6 @@ const installOrUpdatePluginValidator = [
.custom(isSafePath),
(req: express.Request, res: express.Response, next: express.NextFunction) => {
logger.debug('Checking installOrUpdatePluginValidator parameters', { parameters: req.body })
if (areValidationErrors(req, res)) return
const body: InstallOrUpdatePlugin = req.body
@ -149,8 +138,6 @@ const uninstallPluginValidator = [
.custom(isNpmPluginNameValid),
(req: express.Request, res: express.Response, next: express.NextFunction) => {
logger.debug('Checking uninstallPluginValidator parameters', { parameters: req.body })
if (areValidationErrors(req, res)) return
return next()
@ -162,8 +149,6 @@ const existingPluginValidator = [
.custom(isNpmPluginNameValid),
async (req: express.Request, res: express.Response, next: express.NextFunction) => {
logger.debug('Checking enabledPluginValidator parameters', { parameters: req.params })
if (areValidationErrors(req, res)) return
const plugin = await PluginModel.loadByNpmName(req.params.npmName)
@ -184,8 +169,6 @@ const updatePluginSettingsValidator = [
.exists(),
(req: express.Request, res: express.Response, next: express.NextFunction) => {
logger.debug('Checking enabledPluginValidator parameters', { parameters: req.body })
if (areValidationErrors(req, res)) return
return next()
@ -205,8 +188,6 @@ const listAvailablePluginsValidator = [
.custom(isPluginVersionValid),
(req: express.Request, res: express.Response, next: express.NextFunction) => {
logger.debug('Checking enabledPluginValidator parameters', { parameters: req.query })
if (areValidationErrors(req, res)) return
if (CONFIG.PLUGINS.INDEX.ENABLED === false) {