This repository is a header-only C++ logging library with optional tests,
examples, and benchmarks. Keep agent instructions focused on log-it-cpp
itself rather than on generic product or application architecture.
- Keep diffs minimal and focused.
- Do not refactor or apply style changes beyond the lines you directly touch.
- Use Conventional Commits:
type(scope): summary. - Commit headers must be in English and include a descriptive body.
For non-trivial codebase investigation, architecture questions, cross-file edits, refactors, call chains, or unknown implementation locations, use Codebase Memory before Grep/Glob/Read/LSP.
Preferred sequence:
index_status → search_graph / trace_path / get_code_snippet → targeted Read/LSP.
Grep/Glob are fallback or precision-confirmation tools, not first-pass architecture discovery.
Use the project umbrella headers instead of recreating include order manually:
include/logit_cpp/logit.hpp- full library entry point.include/logit_cpp/logit/utils.hpp- utilities module umbrella.include/logit_cpp/logit/formatter.hpp- formatter module umbrella.include/logit_cpp/logit/loggers.hpp- logger backend umbrella.
These headers prepare internal dependencies in the intended order.
<logit.hpp> is the supported application entry point. Module umbrellas are
supported for focused use; logit/log_macros.hpp is an aggregate-owned macro
implementation header and has no standalone-inclusion guarantee. A leaf type
header is standalone only when its documentation and include-contract test say
so. Public aliases such as logit::QueuePolicy are normally consumed through
<logit.hpp> or the relevant module umbrella.
- Do not use
../in#includedirectives. - Within a module (
logit/utils/*,logit/formatter/*,logit/loggers/*) include only headers from the same sub-tree using forward paths. - Cross-module dependencies must come through the nearest umbrella header instead of direct sibling includes.
- Files under
logit/detail/may include other detail headers, but must not include publiclogit/...headers. - Prefer the self-contained public entry points in
include/logit_cpp.
- If a header defines one primary class, use a PascalCase filename.
- If a header contains mixed declarations, helpers, macros, or multiple types, use a snake_case filename.
Read the nearest module guide before editing files in that tree. These guides keep public-header, test, example, documentation, and agent-workflow rules close to the code they govern:
include/logit_cpp/AGENTS.md- public API and header-only implementation contracts.tests/AGENTS.md- test design, registration, and platform-sensitive test rules.examples/AGENTS.md- example portability and dependency expectations.docs/AGENTS.md- documentation consistency and generated output boundaries.guides/AGENTS.md- maintaining playbooks used by humans and coding agents.
When a change crosses module boundaries, follow all applicable guides and record the public contract in the narrowest relevant document. Do not copy the same rule into every guide.
Before submitting a change, inspect both enabled and disabled compile-time
paths. In particular, check that noexcept functions cannot allocate, invoke
user callbacks, or propagate exceptions; that conditions are reachable and
not permanently true or false; that repeated logic has a single owner; and
that optional dependencies do not break a default build or package export.
Run the focused tests plus the relevant CMake configure/build flow and report
platform-only failures explicitly.
For every project-owned C/C++ header, use #pragma once together with a
non-reserved include guard. Guard names must be derived from the project prefix
and header path, and must clearly indicate that the macro is a header guard:
LOGIT_CPP_HEADER_<PATH>_<FILE>_<EXT>_INCLUDEDDo not use identifiers reserved for the compiler, standard library, platform SDK, or other implementation internals. In particular, do not use include guard names that start with an underscore, start with an underscore followed by an uppercase letter, or contain a double underscore anywhere.
Implementation fragments such as .ipp, .inl, or .tpp files may remain
unguarded if they are only included from already guarded headers and are not
intended for direct inclusion. If they are intended to be included directly, they
must follow the same non-reserved guard naming rule.
Before configuring or building, initialize submodules:
git submodule update --init --recursiveRead the matching file in guides/ when the task needs more detail:
guides/README.md- index of available agent instructions.guides/orientation.md- project map, subsystem model, extension recipes, and safety invariants for AI agents.guides/commits.md- commit message rules.guides/cpp_style.md- naming and style guidance.guides/header-impl.md-.hpp/.ipp/.tppownership and include-structure rules.guides/header-impl-RU.md- Russian localization of the header ownership playbook.guides/logging-macros.md- macro-first logging guidance for normal application code and agent behavior.guides/concurrency.md- thread-safety contracts, callback dispatch, mutex ordering, and shutdown invariants.guides/build.md- submodules, configure/build/test/bench flow.guides/ci.md- CI environment parity, toolchain compatibility, sanitizer/timing test guidance, and CI-failure workflow.