fix logger

This commit is contained in:
Hongbo Wu
2024-04-26 12:06:20 +08:00
parent 66d7649620
commit 01246207cb
3 changed files with 5 additions and 8 deletions

View File

@ -7,13 +7,11 @@ import {
enqueueProcessYouTubeVideo,
enqueueTriggerRuleJob,
} from './utils/createTask'
import { buildLogger } from './utils/logger'
import { logger } from './utils/logger'
import { isYouTubeVideoURL } from './utils/youtube'
export type EntityEvent = { id: string }
const logger = buildLogger('pubsub')
const client = new PubSub()
export const createPubSubClient = (): PubsubClient => {

View File

@ -31,7 +31,7 @@ export class CustomTypeOrmLogger
constructor(options?: TypeOrmLoggerOptions) {
super(options)
this.logger = buildLogger('typeorm')
this.logger = logger
}
logQuery(query: string, parameters?: any[], queryRunner?: QueryRunner) {

View File

@ -33,7 +33,7 @@ import {
makeHighlightNodeAttributes,
} from './highlightGenerator'
import { createImageProxyUrl } from './imageproxy'
import { buildLogger, LogRecord } from './logger'
import { logger, LogRecord } from './logger'
interface Feed {
title: string
@ -43,7 +43,6 @@ interface Feed {
description?: string
}
const logger = buildLogger('utils.parse')
const signToken = promisify(jwt.sign)
const axiosInstance = axios.create({
@ -670,7 +669,7 @@ export const htmlToHighlightedMarkdown = (
throw new Error('Invalid html content')
}
} catch (err) {
logger.info(err)
logger.error(err)
return nhm.translate(/* html */ html)
}
@ -690,7 +689,7 @@ export const htmlToHighlightedMarkdown = (
articleTextNodes
)
} catch (err) {
logger.info(err)
logger.error(err)
}
})
html = document.documentElement.outerHTML