本文整理汇总了TypeScript中common/util/paths.mainLogPath函数的典型用法代码示例。如果您正苦于以下问题:TypeScript mainLogPath函数的具体用法?TypeScript mainLogPath怎么用?TypeScript mainLogPath使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了mainLogPath函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: work
async work(): Promise<void> {
const logPath = mainLogPath();
const log = await sf.readFile(logPath, { encoding: "utf8" });
this.push({
log: {
log,
},
});
}
开发者ID:HorrerGames,项目名称:itch,代码行数:9,代码来源:applog-fetcher.ts
示例2: getLogStream
export function getLogStream(): NodeJS.WritableStream {
const logPath = mainLogPath();
try {
mkdirp.sync(path.dirname(logPath));
} catch (err) {
if ((err as any).code === "EEXIST") {
// good
} else {
console.log(`Could not create file sink: ${err.stack || err.message}`);
}
}
return stream({
file: logPath,
size: "2M",
keep: 5,
});
}
开发者ID:itchio,项目名称:itch,代码行数:18,代码来源:index.ts
示例3: async
watcher.on(actions.openAppLog, async (store, action) => {
const path = mainLogPath();
logger.info(`Opening app log at ${path}`);
shell.showItemInFolder(path);
});
开发者ID:itchio,项目名称:itch,代码行数:5,代码来源:preferences.ts
示例4: catch
},
level: LOG_LEVEL,
close: () => {
try {
outStream.end();
} catch (err) {
console.log(`Could not close file sink: ${err.stack || err.message}`);
}
},
});
logger.customOut = customOut;
return logger;
}
}
let defaultLogger: Logger;
if (process.type === "browser") {
const { mainLogPath } = require("common/util/paths");
defaultLogger = makeLogger({ logPath: mainLogPath() }); // log 'metal' process to file
} else {
defaultLogger = makeLogger({}); // don't log browser process to file
}
export const devNull = new Logger({
write: () => {
/* muffin */
},
});
export default defaultLogger;
开发者ID:HorrerGames,项目名称:itch,代码行数:30,代码来源:index.ts
注:本文中的common/util/paths.mainLogPath函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论