agentleFS
leroyguillaumeleroyguillaume/claude/logging-conventions/SKILL.md

logging-conventions

Skill7 starsChanged 3 days agoMITView on GitHub

Logging in any language: debug logs, structured fields, levels. TRIGGER when: writing code that does I/O or external calls, branches non-trivially or runs long; configuring a logging library or subscriber; replacing `print`/`println`/`echo`/`console.log`; user asks about logging or observability. SKIP when: the change adds no behaviour worth logging (formatting, comments, non-logging config).

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Always log with structured fields/key-values, never by interpolating values into the message string.

    line 30
  2. Very specific:

    Use the language's standard structured logging library, configured once at process start.

    line 33

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Logging and observability

Applies to every language and runtime. The language skills give the mechanics (library, level names); config-conventions names the level variable.

  • Emit debug-level logs liberally wherever they help diagnose a problem after the fact: around every external / I/O call (log its inputs and its outcome), at each non-trivial decision branch, and at the boundaries of long or multi-step operations. The bar: a misbehaving program can be understood from its debug output alone, without adding logging and re-running.
  • Reserve info for state transitions worth seeing at the default level; use warn / error for failures (with the cause).
  • Diagnostic verbosity is controlled only by the log level, set through the application's config layer (flag, env var, config file), never by a bespoke --verbose-style flag that gates whole code paths.
  • Always log with structured fields/key-values, never by interpolating values into the message string. One log call should change what the reader knows; no noise, no secrets.
  • Use the language's standard structured logging library, configured once at process start; never print/println/echo/console.log for diagnostics.

Log format — default to text, not json

  • Default the log format to text, never json. A human reading kubectl logs, docker logs or a terminal parses key=value far more easily than one JSON object per line. JSON is opt-in, for deployments whose log pipeline parses it.
  • Drive it off LOG_FORMAT (<TOOL>_LOG_FORMAT for a CLI; text | json, default text) and keep the binary's default and every deployment default in sync — a Helm chart's logging.format value that disagrees with what the binary does on its own is a bug.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.