← back technical writeup

systems · search · data structures

Logman Nov 2025

C++ CLI that loads a large timestamped log, supports several search modes, and lets me build an excerpt list of the lines that matter.

C++ STL unordered_map hash indexes binary search Makefile g++ -O3

// overview

what it does

It loads a master log shaped like timestamp|category|message, then opens an interactive prompt. I can search by time range, exact time, category, or keywords, then append, delete, or reorder hits into an excerpt list to print.

// architecture

how it’s built

Indexing

Lookup tables are built once on load so searches avoid a full scan. Categories and keywords use hash maps; timestamps stay sorted for range queries.

Excerpt list

Search hits go into a separate list I can edit (append, delete, move, sort, print). The original log doesn’t get mutated.

commands: t · m · c · k · a · g · d · b · e · s · l · r · p · q indexes: unordered_map<category → ids>, keyword → ids, ordered timestamps

// stack

languages · libraries

// concepts

Concepts applied

on load

Hash indexes

unordered_map is built once so category and keyword lookups stay near O(1) instead of scanning the full file each time.

timestamp commands

Sorted timestamps

Times stay ordered so range / exact searches stay fast without rebuilding a new structure for every query.

excerpt list

Separate editable list

Hits go into a separate list I can rearrange. The master log stays read-only; the excerpt is the working set.

keyword matching

Case-insensitive search

Compare in lowercase, but print the original line so formatting in the log is preserved.

// design choices

why this shape

Scanning a large log on every search is too slow. Most of the work was choosing what to index up front so category and keyword lookups stay fast, time ranges stay memory-efficient, and the CLI stays practical to use.