本文整理汇总了TypeScript中common/Logger.Logger.debug方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Logger.debug方法的具体用法?TypeScript Logger.debug怎么用?TypeScript Logger.debug使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类common/Logger.Logger
的用法示例。
在下文中一共展示了Logger.debug方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: async
stop: async () => {
logger.debug(`Asked to stop, cancelling butler process`);
cancelled = true;
if (client) {
await client.call(messages.LaunchCancel, {});
}
},
示例2: getClient
export async function call<Params, Res>(
store: Store,
logger: Logger,
rc: RequestCreator<Params, Res>,
params: Params,
setup?: SetupFunc
): Promise<Res> {
const client = await getClient(store, logger);
try {
logger.debug(`đ ${rc({} as any)(client).method}`);
return await client.call(rc, params, setup);
} catch (e) {
if (isCancelled(e)) {
// nvm
} else if (isAborted(e)) {
// nvm
} else {
logger.error(`Caught butler error:`);
if (isInternalError(e)) {
const ed = getRpcErrorData(e);
if (ed) {
logger.error(`butler version: ${ed.butlerVersion}`);
logger.error(`Golang stack:\n${ed.stack}`);
}
logger.error(`JavaScript stack: ${e.stack}`);
} else {
logger.error(`${e.message}`);
}
}
throw e;
}
}
示例3: async
convo.on(messages.Log, async ({ level, message }) => {
switch (level) {
case "debug":
logger.debug(message);
break;
case "info":
logger.info(message);
break;
case "warning":
logger.warn(message);
break;
case "error":
logger.error(message);
break;
default:
logger.info(`[${level}] ${message}`);
break;
}
});
示例4: performLaunch
//.........这里部分代码省略.........
return { continue: true };
}
return { continue: false };
});
client.on(messages.PrereqsEnded, async () => {
closePrereqsModal();
});
client.on(messages.LaunchWindowShouldBeForeground, async ({ hwnd }) => {
try {
require("asfw").SetForegroundWindow(hwnd);
} catch (e) {
logger.warn(`Could not set foreground window: ${e.stack}`);
}
});
client.on(messages.LaunchRunning, async () => {
logger.info("Now running!");
ctx.emitProgress({ progress: 1, stage: "run" });
if (preferences.preventDisplaySleep) {
powerSaveBlockerId = powerSaveBlocker.start(
"prevent-display-sleep"
);
}
});
client.on(messages.LaunchExited, async () => {
logger.info("Exited!");
ctx.emitProgress({ progress: -1, stage: "clean" });
});
client.on(messages.AllowSandboxSetup, async () => {
let messageString: ILocalizedString = "";
let detailString: ILocalizedString = "";
if (process.platform === "win32") {
messageString = ["sandbox.setup.windows.message"];
detailString = ["sandbox.setup.windows.detail"];
} else {
messageString = ["sandbox.setup.linux.message"];
detailString = ["sandbox.setup.linux.detail"];
}
const res = await promisedModal(
store,
modalWidgets.sandboxBlessing.make({
window: "root",
title: ["sandbox.setup.title"],
message: messageString,
detail: detailString,
widgetParams: {},
buttons: [
{
label: ["sandbox.setup.proceed"],
action: modalWidgets.sandboxBlessing.action({
sandboxBlessing: true,
}),
icon: "security",
},
"cancel",
],
})
);
if (res && res.sandboxBlessing) {
return { allow: true };
}
return { allow: false };
});
await client.call(messages.Launch, {
caveId: cave.id,
prereqsDir,
sandbox: preferences.isolateApps,
});
} finally {
closePrereqsModal();
client.close();
if (powerSaveBlockerId) {
powerSaveBlocker.stop(powerSaveBlockerId);
}
}
},
stop: async () => {
logger.debug(`Asked to stop, cancelling butler process`);
cancelled = true;
if (client) {
await client.call(messages.LaunchCancel, {});
}
},
});
if (cancelled) {
logger.debug(`throwing cancelled`);
throw new Cancelled();
}
}