feat(logging): add token truncation helper

This commit is contained in:
2026-01-02 12:26:29 -05:00
parent 77027d762e
commit ff7dff7571
2 changed files with 35 additions and 0 deletions

11
src/grist_mcp/logging.py Normal file
View File

@@ -0,0 +1,11 @@
"""Logging configuration and utilities."""
def truncate_token(token: str) -> str:
"""Truncate token to show first 3 and last 3 chars.
Tokens 8 chars or shorter show *** for security.
"""
if len(token) <= 8:
return "***"
return f"{token[:3]}...{token[-3:]}"