fix: logger

Signed-off-by: Innei <i@innei.in>
This commit is contained in:
Innei
2024-04-20 17:02:04 +08:00
parent 6462d75dc6
commit e66e49a72f
2 changed files with 4 additions and 7 deletions

View File

@@ -146,7 +146,7 @@ export class AuthService {
return user.id === adminUserId
}
} catch (error) {
this.logger.error(`clerk jwt valid error: ${error.message}`)
this.logger.debug(`clerk jwt valid error: ${error.message}`)
return false
}
}

View File

@@ -1,4 +1,3 @@
import { inspect } from 'util'
import algoliasearch from 'algoliasearch'
import { omit } from 'lodash'
import removeMdCodeblock from 'remove-md-codeblock'
@@ -300,8 +299,7 @@ export class SearchService {
this.executeAlgoliaSearchOperationIfEnabled(async (index) => {
this.logger.log(
'detect post created or update, save to algolia, data: ',
inspect(data),
`detect post created or update, save to algolia, data id:${data.id}`,
)
await index.saveObject(
adjustObjectSizeEfficiently({
@@ -328,8 +326,7 @@ export class SearchService {
this.executeAlgoliaSearchOperationIfEnabled(async (index) => {
this.logger.log(
'detect note create or update, save to algolia, data: ',
inspect(data),
`detect post created or update, save to algolia, data id:${data.id}`,
)
await index.saveObject(
adjustObjectSizeEfficiently({
@@ -352,7 +349,7 @@ export class SearchService {
@OnEvent(BusinessEvents.NOTE_DELETE)
async onPostDelete({ data: id }: { data: string }) {
await this.executeAlgoliaSearchOperationIfEnabled(async (index) => {
this.logger.log('detect data delete, save to algolia, data: ', id)
this.logger.log(`detect data delete, save to algolia, data id: ${id}`)
await index.deleteObject(id)
})