Sfoglia il codice sorgente

fix(logger): correct log directory path to include /log subdirectory

Signed-off-by: Omar Mohamed <mohamed.omar67492@gmail.com>
Omar Mohamed 2 mesi fa
parent
commit
e4e8338e5c
3 ha cambiato i file con 3 aggiunte e 3 eliminazioni
  1. 1 1
      AGENTS.md
  2. 1 1
      src/utils/logger.test.ts
  3. 1 1
      src/utils/logger.ts

+ 1 - 1
AGENTS.md

@@ -268,7 +268,7 @@ Windows: Press WIN+R and paste %USERPROFILE%\.local\share\opencode\log
 Log files are named with timestamps (e.g., 2025-01-09T123456.log) and the most recent 10 log files are kept.
 You can set the log level with the --log-level command-line option to get more detailed debug information. For example, opencode --log-level DEBUG.
 ### Plugin
-~/.local/share/opencode/oh-my-opencode-slim.<timestamp>.log
+~/.local/share/opencode/log/oh-my-opencode-slim.<timestamp>.log
 
 ## Cloned Dependency Source
 

+ 1 - 1
src/utils/logger.test.ts

@@ -187,7 +187,7 @@ describe('logger', () => {
     delete process.env.OPENCODE_LOG_DIR;
     try {
       expect(getLogDir()).toBe(
-        path.join(os.homedir(), '.local/share/opencode'),
+        path.join(os.homedir(), '.local/share/opencode/log'),
       );
     } finally {
       if (origLogDir === undefined) {

+ 1 - 1
src/utils/logger.ts

@@ -13,7 +13,7 @@ let writeChain: Promise<void> = Promise.resolve();
 function getLogDir(): string {
   return (
     process.env.OPENCODE_LOG_DIR ??
-    path.join(os.homedir(), '.local/share/opencode')
+    path.join(os.homedir(), '.local/share/opencode/log')
   );
 }