Notebook.fix logging

From causify-ai/helpers · View interactive version

Notebook.fix logging is an AI agent skill from the GitHub repository causify-ai/helpers. Use idiom for controlling logging in Jupyter notebooks

How to use this skill

Skill file

Goal

.claude/skills/notebook.rules.md under

## Use Standard Template Structure

notebook initialization

```

import helpers.hnotebook as hnotebo

def init_loggers(notebook_log: logging.Logger) -> None:

"""

Wire the notebook logger into the utils logger.

:param notebook_log: logger owned by the notebook

"""

hnotebo.init_loggers(notebook_log, utils_log=_LOG)

```

hdbg at INFO level, and redirects the notebook and utils loggers to

print

inside init_loggers() with hnotebo.set_logger_to_print():

```

hnotebo.set_logger_to_print(logging.getLogger("causalml"))

```

instead of logging.basicConfig() or hdbg.init_logger()

Workflow

Sync Notebook

in # Code Architecture and Responsibility -> `## Utilities vs. Notebook

Responsibilities in .claude/skills/notebook.rules.md`

Conventions

.claude/skills/notebook.rules.md

Verification

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.