Merge tag 'v0.3.0' into chore/sync-gemini-cli-v0.3.0

This commit is contained in:
mingholy.lmh 2025-09-10 21:01:40 +08:00
commit 14ea33063f
583 changed files with 30160 additions and 10770 deletions

View file

@ -5,16 +5,17 @@
*/
import { useState, useEffect } from 'react';
import type { Storage } from '@qwen-code/qwen-code-core';
import { sessionId, Logger } from '@qwen-code/qwen-code-core';
/**
* Hook to manage the logger instance.
*/
export const useLogger = () => {
export const useLogger = (storage: Storage) => {
const [logger, setLogger] = useState<Logger | null>(null);
useEffect(() => {
const newLogger = new Logger(sessionId);
const newLogger = new Logger(sessionId, storage);
/**
* Start async initialization, no need to await. Using await slows down the
* time from launch to see the gemini-cli prompt and it's better to not save
@ -26,7 +27,7 @@ export const useLogger = () => {
setLogger(newLogger);
})
.catch(() => {});
}, []);
}, [storage]);
return logger;
};