Skip to content

Commit

Permalink
fix: Add timestamps to error logs (#456)
Browse files Browse the repository at this point in the history
  • Loading branch information
Robdel12 authored Jan 16, 2020
1 parent 6b5b78b commit b8c0683
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/services/asset-discovery-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,8 @@ export class AssetDiscoveryService extends PercyClientService {
maybeResources = await Promise.all(maybeResourcePromises)
profile('--> assetDiscoveryServer.waitForResourceProcessing')
} catch (error) {
logger.error(`${error.name} ${error.message}`)
logger.debug(error)
logger.error(addLogDate(`${error.name} ${error.message}`))
logger.debug(addLogDate(error))
}

// always release the page from the pool
Expand Down
4 changes: 2 additions & 2 deletions src/utils/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ export function profile(id: string, meta?: any): winston.Logger | undefined {
}

export function logError(error: any) {
logger.error(`${error.name} ${error.message}`)
logger.debug(error)
logger.error(addLogDate(`${error.name} ${error.message}`))
logger.debug(addLogDate(error))
}

export function createFileLogger(filename: string) {
Expand Down

0 comments on commit b8c0683

Please sign in to comment.