Log Viewer
Kode ships a log viewer WebView for the KBEngine logger, to view, filter, and export logs.
The logger protocol adaptation is not finished yet. The extension clearly states this capability is not supported yet, so an unverified protocol implementation is never presented as a working one.
Overview
- Connect to the logger port
- View connection status and limitation notes
- Level filtering
- Component filtering
- Keyword search
- Regular expression search
- Log export
- Raw log ERROR scan (offline, no logger connection needed)
Related Commands
kbengine.logs.showViewerkbengine.logs.connectkbengine.logs.disconnectkbengine.logs.clearkbengine.logs.exportkbengine.logs.scanErrors
See Commands and Panels for command details.
Related Configuration
kbengine.logAutoConnect
Whether to auto-connect to the log port when starting the server.
kbengine.maxLogEntries
The maximum number of cached entries in the log WebView.
If you notice:
- The panel getting sluggish
- Clearly delayed scrolling
- Memory growing over long runs
lower this value first.
Jump Decision-Path Log
When an F12 jump finds nothing, the extension can print the whole decision path — how many layers were checked, which one hit or missed, why it gave up, and how long each step took — to an output channel, so you can see exactly which layer broke and paste the captured output to the maintainer.
Switch
- Setting key:
kbengine.jumpLog - Type: boolean, values
true/false, defaultfalse(off) - Zero overhead when off: log messages are passed lazily (
() =>), and the switch is checked before any string is built — with the switch off there is no string construction and no output at all - This is an editor-behavior setting and deliberately not part of
.kbengine/debug.json— that file holds debug launch actions (commands/scripts/cwd). The log switch lives in the VS Code settings system, so toggling takes effect immediately without editing files or reloading the window
Enable either way.
Way 1: VS Code Settings UI (search term jumpLog)
- Open Settings with
Ctrl+,; - Type
jumpLogand find Kbengine: Jump Log (the item described as the jump decision-path logging switch); - Tick it — the next F12 is logged.
Way 2: settings.json snippet
In your user or workspace .vscode/settings.json:
{
"kbengine.jumpLog": true
}Where The Logs Go
- Open the Output panel:
Ctrl+Shift+U(View → Output); - Pick the KBEngine Navigation channel from the dropdown at the top right;
- Type the filter
[kode-jump]in the filter box.
Disable: set the setting back to false (or remove the key) — logging stops on the next jump, no reload needed.
A Real Failed-Jump Log Sample
Source: self.func(*(self.args + args)) at scripts/common/Functor.py:20 in a real KBEngine project, pressed F12.
[kode-jump][info] F12 .../scripts/common/Functor.py:20:11 line="self.func(*(self.args + args))"
[kode-jump][info] resolve start query=func file=Functor.py:20 class=Functor
[kode-jump][info] def full index done: 1 .def → 1 entity, 10ms
[kode-jump][debug] def index[object-level] Functor → miss (negative cache)
[kode-jump][debug] def index[file-level] Functor.py → miss (no owner)
[kode-jump][info] layer1 entity-def missed (property(func) object=Functor miss; property(func) file=Functor.py miss; method object=Functor miss; method file=Functor.py miss) 7ms
[kode-jump][info] py query Functor.py:20 method=func
[kode-jump][info] py full-repo index done: 12 files → 3 classes, 3ms (cached per session)
[kode-jump][debug] py (1) static-class MRO missed (enclosing=Functor)
[kode-jump][info] composition roots derived: 1 root: [Account] 6ms
[kode-jump][debug] py roots containing Functor → [none]
[kode-jump][info] py missed: none of static class / composition roots / reverse descendants has func (9ms)
[kode-jump][info] layer2 python-mro missed (no provider in mro/composition-roots/descendants) 9ms
[kode-jump][info] layer3 file-scope missed (class Functor (of 1 classes in file) does not define func) 0ms
[kode-jump][info] jump gave up: all three layers missed (query=func) total 17msLine by line:
F12 …: entry — file, line:column, and the text of the cursor line;resolve start … class=Functor: the symbol being resolved (query) and the classselfsits in;def full index done …: cost of building the.defindex layer 1 needs (cached per session, built once);def index[object-level]/[file-level] …: layer 1's two probes — take the.defby class name, then by file ownership; both missed;layer1 entity-def missed (…): layer 1 finished; the parentheses carry each probe's miss reason;py query …andpy full-repo index done …: layer 2 starts; the latter is the main source of "takes ages to load" (one-time full.pyscan, then cached);py (1) static-class MRO missed: layer 2 step 1 —funcis not in the static class's own inheritance chain;composition roots derived …andpy roots containing … [none]: layer 2 step 2 — which composition roots (entities.xml ×.def× Python inheritance) contain this class;Functorbelongs to none;layer2 python-mro missed (…): layer 2 step 3 — neither MRO, composition roots, nor reverse descendants hasfunc;- layer 2 has its own switch,
kbengine.python.enableMroJump(default on): when off, the wholepy query/composition roots derivedblock above disappears and only onelayer2 python-mro skipped (disabled by setting)line is recorded, while layer 3 still runs — turn it off first to isolate misbehaving jumps;
- layer 2 has its own switch,
layer3 file-scope missed (…): last layer — the current file's class scope and file-local MRO don't define it either;jump gave up: all three layers missed … total …: the give-up point — null is returned only after all three layers miss. This failure is expected:funcis an attribute assigned in__init__, not a method of any class.
When a jump hits, the winning layer prints layerN … hit → file:line and the jump lands there. Pasting this panel excerpt to the maintainer pinpoints the failing layer immediately.
Typical Flows
Day-to-Day Viewing
- Start the KBEngine components
- Run
Show Log Viewer - Connect to the logger
- Filter by level and component to inspect problems
Investigating Problems
- Open the log panel
- Locate entity names, component names, or error fragments by keyword
- Enable regex search when needed
- Export the logs for further analysis
Export
Logs can be exported as:
txtlogjson
Good for:
- Preserving the scene of a problem
- Handing to colleagues for investigation
- Offline analysis with scripts
Raw Log ERROR Scan
kbengine.logs.scanErrors scans raw log files on disk offline, without a logger port connection. After running it, pick files or folders (folders scan one level of .log/.txt/.out, sorted by filename); the extension aggregates ERROR/CRITICAL lines by "component + normalized signature" and shows them in the WebView panel.
- Normalized signature: digit runs folded into
N, whitespace compressed, truncated to 160 characters, so the same error with different ids/counters does not split into multiple rows - Aggregate table: count (descending) / level / component / signature / most recent occurrence; time is taken only from timestamps carried in the line, non-standard lines show
— - Clicking a hit row opens the source file and locates the earliest line of that signature
- The "Rescan" button re-runs on the previous batch of files without re-popping the dialog
- A single file over the 64MB read limit, or a read failure, is flagged with its failure reason in the scanned-file list without interrupting the rest
- A summary row gives file count, total lines, total ERROR/CRITICAL entries, and the number of distinct signatures
The scan uses the same parser family as the log panel (logger line format / standard format / non-standard heuristic), so non-standard lines containing error/failed wording are also counted.
Usage Advice
Team Collaboration
Unify the logger port configuration, so "the extension opens but logs won't connect" doesn't happen across people's environments.
Heavy Log Environments
Recommended:
- Lower
kbengine.maxLogEntries - Filter by component first
- Then layer keyword search on top
Current Boundaries
The current log capability leans "interface and export layer"; it is not a stable collector with the official logger protocol adaptation completed.
Deliberately not done:
- Saving filter presets
- Multi-session comparison
- Automatic clustering by entity semantics