本文整理匯總了TypeScript中ngx-logger.NGXLogger類的典型用法代碼示例。如果您正苦於以下問題:TypeScript NGXLogger類的具體用法?TypeScript NGXLogger怎麽用?TypeScript NGXLogger使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了NGXLogger類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: finalize
finalize(() => {
const elapsed = Date.now() - started;
const msg = `${req.method} "${req.urlWithParams}" ${ok} in ${elapsed} ms.`;
if(ok == "failed"){
this.logger.error(msg);
}else{
this.logger.trace(msg);
}
})
示例2: switchMap
switchMap((params: ParamMap) => {
const gamenr = params.get('gamenr')
this.logger.debug(`extracted ${gamenr}`)
if(gamenr){
return this.betterdb.getGameWithBetsForUsers(parseInt(gamenr))
} else {
//TODO: maybe redirect
return EMPTY
}
}))
示例3: intercept
intercept(req: HttpRequest<any>, next: HttpHandler) {
const authToken = localStorage.getItem(Environment.XAUTHTOKEN)
if(authToken){
const authReq = req.clone({
headers: req.headers.set(Environment.XAUTHTOKEN, authToken)
// .set(Environment.XAUTHTOKEN, authToken)
})
return next.handle(authReq)
}else{
this.logger.debug("auth-interceprtor: no authToken!")
return next.handle(req)
}
}
示例4: loadSavedData
loadSavedData(): void {
this.logger.info('loadSaveData from next Event', new Date());
this.daysWithEvents = this.filterOldEvents(super.loadSavedData() as Array<Day>);
}