Skip to content
Back to skills

Log With Lazy Formatting

ASecurity

When adding a logging call, pass the arguments to the logger instead of formatting first

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 17, 2026
ai-agents

Security analysis

A100/100

Scanned October 17, 2026

npx -y skills add samugit83/cortex --skill log-with-lazy-formatting --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Log With Lazy Formatting?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Log With Lazy Formatting
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/samugit83-log-with-lazy-formatting/badge)](https://www.skillsdirectory.com/skills/samugit83-log-with-lazy-formatting)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: log-with-lazy-formatting
description: When adding a logging call, pass the arguments to the logger instead of formatting first
---

# Logging

Hand the logger the pattern and the values, and let it decide whether the
message is ever built.

- Write `log.info("loaded %s rows from %s", n, path)`, not
  `log.info(f"loaded {n} rows from {path}")`.
- A call that is filtered out by its level then costs almost nothing, which
  matters in the inner loops where logging is most tempting.
- Keep the pattern a literal: a pattern built at the call site cannot be
  grouped by the aggregation tools that read the output later.

The same applies to `warning`, `error` and `debug`.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.