本文整理汇总了TypeScript中@coder/logger.logger类的典型用法代码示例。如果您正苦于以下问题:TypeScript logger类的具体用法?TypeScript logger怎么用?TypeScript logger使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了logger类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: prompt
public prompt(severity: Severity, message: string, _buttons: INotificationButton[], _onCancel: () => void): INotificationHandle {
switch (severity) {
case Severity.Info: logger.info(message); break;
case Severity.Warning: logger.warn(message); break;
case Severity.Error: logger.error(message); break;
}
return {
close: (): void => undefined,
updateMessage: (): void => undefined,
updateButtons: (): void => undefined,
};
}
开发者ID:AhmadAlyTanany,项目名称:code-server,代码行数:13,代码来源:notification.ts
示例2: field
req.on("end", () => {
const body = data.join("");
fs.writeFileSync(fullPath, body);
logger.debug("Wrote resource", field("path", fullPath), field("content-length", body.length));
res.status(200);
res.end();
});
开发者ID:AhmadAlyTanany,项目名称:code-server,代码行数:7,代码来源:server.ts
示例3: stringify
eventEmitter!.on(event, (...args: any[]) => {
logger.trace(() => [
`${event}`,
field("id", message.getId()),
field("args", args.map((a) => stringify(a))),
]);
cb(...args);
});
开发者ID:AhmadAlyTanany,项目名称:code-server,代码行数:8,代码来源:evaluate.ts
示例4: task
public start<T>(title: string, task: (progress: IProgress) => Promise<T>): Promise<T> {
logger.info(title);
return task({
report: (progress): void => {
logger.info(`${title} progress: ${progress}`);
},
});
}
开发者ID:AhmadAlyTanany,项目名称:code-server,代码行数:9,代码来源:notification.ts
示例5: catch
send: (data): void => {
if (ws.readyState !== ws.OPEN) {
return;
}
try {
ws.send(data);
} catch (error) {
logger.error(error.message);
}
},
开发者ID:AhmadAlyTanany,项目名称:code-server,代码行数:10,代码来源:server.ts
示例6: switch
actions.MenuRegistry.appendMenuItem = (id: actions.MenuId, item: actions.IMenuItem | actions.ISubmenuItem): IDisposable => {
if (actions.isIMenuItem(item)) {
switch (item.command.id) {
case ToggleDevToolsAction.ID: // There appears to be no way to toggle this programmatically.
logger.debug(`Skipping unsupported menu item ${item.command.id}`);
return {
dispose: (): void => undefined,
};
}
}
return originalAppend(id, item);
};
开发者ID:AhmadAlyTanany,项目名称:code-server,代码行数:14,代码来源:menuRegistry.ts
示例7: parseCookies
const isAuthed = (req: http.IncomingMessage): boolean => {
try {
if (!options.password || options.bypassAuth) {
return true;
}
// Try/catch placed here just in case
const cookies = parseCookies(req);
if (cookies.password && safeCompare(cookies.password, options.password)) {
return true;
}
} catch (ex) {
logger.error("Failed to parse cookies", field("error", ex));
}
return false;
};
开发者ID:AhmadAlyTanany,项目名称:code-server,代码行数:17,代码来源:server.ts
注:本文中的@coder/logger.logger类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论