本文整理汇总了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>);
}