當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript logger.logger類代碼示例

本文整理匯總了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;未經允許,請勿轉載。