logging
v1.0.6 — Trace every authored function, including tests and fixtures: print its incoming parameters at entry and return value just before returning. Keep it to plain print() — no logging modules or lo
Files1
View on GitHubSKILL.mdprogramming_prompt_rewritten_with_evals/prompts/programming-skills/logging/SKILL.md
GitHubFunction entry and exit prints
Every function or method you create or edit, including constructors, tests,
fixtures and private helpers, uses builtin print() for its own entry and
normal exits. Lambdas and exception exits are exempt. Use no logging framework,
custom logger or log files.
The first statement after the docstring prints every parameter's actual name
and value, including optional None values and receivers self/cls. Put this
print before parsing, validation, helper calls and global/nonlocal
declarations. A function with no parameters still prints an entry message,
such as parameters=none, before any declarations.
A constructor with self is not parameterless; object.__repr__(self) safely
identifies it without reading uninitialized fields or recursing through a
custom representation.
Immediately before each normal return, print its complete value. For a tuple,
print all elements or the tuple itself. Before normal fallthrough, print None,
including at the end of constructors and assertion-only tests. A final
print(None) needs no additional return None. Nothing is required before
raise.
When a loop is the last work in a function, put that exit print after the loop.
A helper's prints do not cover its caller. Assign the result of helper(),
print it, then return it rather than returning the call directly. Branches
may converge on one print and return. Test entry prints precede stdout capture,
and the exit print follows the last assertion.
def update(value):
"""Replace stored state.
Parameters: value - the new state.
Returns: the stored state.
"""
print(f"value={value}")
global stored_state
stored_state = value
print(stored_state)
return stored_state
Before committing, compare every changed function's signature with its first statement and inspect each reachable normal exit, in application and test files. Review tests and fixtures as separate functions; application prints do not cover them.