Skip to content

Commit 41268b5

Browse files
CopilotMte90
andcommitted
Migrate all modules to use centralized logger and simplify plugin docs
Co-authored-by: Mte90 <403283+Mte90@users.noreply.github.com>
1 parent bfddae4 commit 41268b5

File tree

4 files changed

+10
-20
lines changed

4 files changed

+10
-20
lines changed

analyzer.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import traceback
55
import sqlite3
66
import importlib.resources
7-
import logging
87
from pathlib import Path
98
from typing import Optional, Dict, Any, List
109

@@ -14,6 +13,8 @@
1413
from db import create_analysis, store_file, update_analysis_status
1514
from external_api import get_embedding_for_text, call_coding_api
1615
from llama_index.core import Document
16+
from logger import get_logger
17+
import logging
1718

1819
# reduce noise from httpx used by external libs
1920
logging.getLogger("httpx").setLevel(logging.WARNING)
@@ -54,9 +55,7 @@
5455
DB_LOCK_RETRY_COUNT = 6
5556
DB_LOCK_RETRY_BASE_DELAY = 0.05 # seconds, exponential backoff multiplier
5657

57-
# configure basic logging for visibility
58-
logging.basicConfig(level=logging.INFO)
59-
logger = logging.getLogger(__name__)
58+
logger = get_logger(__name__)
6059

6160

6261
def detect_language(path: str):

db.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,11 @@
44

55
from config import CFG # config (keeps chunk_size etc if needed)
66
import atexit
7-
import logging
87
import threading
98
import queue
9+
from logger import get_logger
1010

11-
logging.basicConfig(level=logging.INFO)
12-
_LOG = logging.getLogger(__name__)
11+
_LOG = get_logger(__name__)
1312

1413
# registry of DBWriter instances keyed by database path
1514
_WRITERS = {}

plugin/README.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,9 @@ The plugin ZIP will be in `build/distributions/`.
2929
## Usage
3030

3131
1. Open the PicoCode RAG tool window (right sidebar)
32-
2. Configure your OpenAI-compatible API:
33-
- API Base URL (e.g., `https://api.openai.com/v1`)
34-
- API Key (stored securely in IDE password safe)
35-
- Embedding Model (e.g., `text-embedding-3-small`)
36-
- Coding Model (e.g., `gpt-4`)
37-
3. Click "Save API Key" to store it securely
38-
4. Click "Start Server" to launch the Python backend
39-
5. Click "Index Project" to index your current project
40-
6. Ask questions in the query box and click "Query"
32+
2. Click "Start Server" to launch the Python backend
33+
3. Click "Index Project" to index your current project
34+
4. Ask questions in the query box and click "Query"
4135

4236
## Requirements
4337

projects.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,15 @@
66
import json
77
import sqlite3
88
import hashlib
9-
import logging
109
from pathlib import Path
1110
from typing import Dict, List, Optional, Any
1211
from datetime import datetime
1312

1413
# Import shared database utilities to avoid code duplication
1514
from db import _get_connection
15+
from logger import get_logger
1616

17-
# Configure logging
18-
logging.basicConfig(level=logging.INFO)
19-
logger = logging.getLogger(__name__)
17+
logger = get_logger(__name__)
2018

2119
# Default projects directory
2220
PROJECTS_DIR = os.path.expanduser("~/.picocode/projects")

0 commit comments

Comments
 (0)