RKiding/Awesome-finance-skills / skills/alphaear-reporter
alphaear-reporter
VerifiedPlan, write, and edit professional financial reports; generate finance chart configurations. Use when condensing finance analysis into a structured output.
scripts/utils/logging_setup.py
View on GitHubimport os
import sys
from datetime import datetime
from typing import Optional
from loguru import logger
def setup_file_logging(
run_id: str,
log_dir: str = "logs",
level: str = "INFO",
retention: str = "10 days",
rotation: str = "20 MB",
) -> str:
"""Configure Loguru to log to stderr + a per-run file.
Returns the log file path.
"""
os.makedirs(log_dir, exist_ok=True)
# Remove default handler to avoid duplicate logs.
logger.remove()
# Console
logger.add(sys.stderr, level=level, backtrace=False, diagnose=False)
# File (safe for multi-thread via enqueue)
log_path = os.path.join(log_dir, f"signalflux_{run_id}.log")
logger.add(
log_path,
level=level,
rotation=rotation,
retention=retention,
enqueue=True,
backtrace=True,
diagnose=False,
encoding="utf-8",
)
return log_path
def make_run_id(prefix: Optional[str] = None) -> str:
ts = datetime.now().strftime("%Y%m%d_%H%M%S")
return f"{prefix}_{ts}" if prefix else ts
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |