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

Introduce tags to the logger

That could help to filter unneeded logs and/or select particular
components
This commit is contained in:
Chocobozzz 2021-03-05 13:26:02 +01:00
parent d007175238
commit 452b3bea08
No known key found for this signature in database
GPG key ID: 583A612D890159BE
8 changed files with 66 additions and 23 deletions

View file

@ -1,15 +1,17 @@
import * as Bluebird from 'bluebird'
import { Transaction } from 'sequelize'
import { getServerActor } from '@server/models/application/application'
import { checkUrlsSameHost, getAPId } from '../../helpers/activitypub'
import { logger, loggerTagsFactory } from '../../helpers/logger'
import { doRequest } from '../../helpers/requests'
import { CRAWL_REQUEST_CONCURRENCY } from '../../initializers/constants'
import { VideoShareModel } from '../../models/video/video-share'
import { MChannelActorLight, MVideo, MVideoAccountLight, MVideoId } from '../../types/models/video'
import { getOrCreateActorAndServerAndModel } from './actor'
import { sendUndoAnnounce, sendVideoAnnounce } from './send'
import { getLocalVideoAnnounceActivityPubUrl } from './url'
import * as Bluebird from 'bluebird'
import { doRequest } from '../../helpers/requests'
import { getOrCreateActorAndServerAndModel } from './actor'
import { logger } from '../../helpers/logger'
import { CRAWL_REQUEST_CONCURRENCY } from '../../initializers/constants'
import { checkUrlsSameHost, getAPId } from '../../helpers/activitypub'
import { MChannelActorLight, MVideo, MVideoAccountLight, MVideoId } from '../../types/models/video'
import { getServerActor } from '@server/models/application/application'
const lTags = loggerTagsFactory('share')
async function shareVideoByServerAndChannel (video: MVideoAccountLight, t: Transaction) {
if (!video.hasPrivacyForFederation()) return undefined
@ -25,7 +27,10 @@ async function changeVideoChannelShare (
oldVideoChannel: MChannelActorLight,
t: Transaction
) {
logger.info('Updating video channel of video %s: %s -> %s.', video.uuid, oldVideoChannel.name, video.VideoChannel.name)
logger.info(
'Updating video channel of video %s: %s -> %s.', video.uuid, oldVideoChannel.name, video.VideoChannel.name,
lTags(video.uuid)
)
await undoShareByVideoChannel(video, oldVideoChannel, t)