调整策划调试日志默认开关
npm run agc 开发启动时默认开启 design debug 其他启动方式默认不创建 .debug 目录
This commit is contained in:
@@ -20,6 +20,7 @@ import {
|
||||
const appRoot = fileURLToPath(new URL('..', import.meta.url));
|
||||
const repoRoot = resolve(appRoot, '../..');
|
||||
const tauriCliPath = resolve(repoRoot, 'node_modules/@tauri-apps/cli/tauri.js');
|
||||
const AGC_DESIGN_DEBUG_ENV = 'GENARRATIVE_AGC_DESIGN_DEBUG';
|
||||
|
||||
function buildTauriArguments(argv, devUrl = readAgcDevEndpoint().url) {
|
||||
const args = [...argv];
|
||||
@@ -108,7 +109,10 @@ async function runTauriDev(
|
||||
if (!prepared || shutdownSignal) return 1;
|
||||
const tauriArguments = buildTauriArguments(argv, endpoint.url);
|
||||
child = spawnCli(tauriArguments, {
|
||||
env: withAgcDevEndpointEnv(endpoint),
|
||||
env: {
|
||||
...withAgcDevEndpointEnv(endpoint),
|
||||
[AGC_DESIGN_DEBUG_ENV]: '1',
|
||||
},
|
||||
});
|
||||
const childResult = waitForCli(child);
|
||||
const outcome = await Promise.race([
|
||||
|
||||
@@ -460,6 +460,13 @@ fn build_design_request(
|
||||
|
||||
// 调试队列只接收副本,写盘慢或失败时丢弃,不参与会话恢复。
|
||||
fn design_debug(root: &Path, kind: &str, data: Value) {
|
||||
if std::env::var("GENARRATIVE_AGC_DESIGN_DEBUG")
|
||||
.ok()
|
||||
.as_deref()
|
||||
!= Some("1")
|
||||
{
|
||||
return;
|
||||
}
|
||||
type Entry = (PathBuf, Value);
|
||||
static QUEUE: OnceLock<std::sync::mpsc::SyncSender<Entry>> = OnceLock::new();
|
||||
let sender = QUEUE.get_or_init(|| {
|
||||
|
||||
Reference in New Issue
Block a user