MCPcopy Create free account
hub / github.com/AgentOps-AI/agentops / AgentOpsLogFormatter

Class AgentOpsLogFormatter

agentops/logging/formatters.py:5–24  ·  view source on GitHub ↗

Formatter for console logging with colors and prefix.

Source from the content-addressed store, hash-verified

3
4
5class AgentOpsLogFormatter(logging.Formatter):
6 """Formatter for console logging with colors and prefix."""
7
8 blue = "\x1b[34m"
9 bold_red = "\x1b[31;1m"
10 reset = "\x1b[0m"
11 prefix = "🖇 AgentOps: "
12
13 FORMATS = {
14 logging.DEBUG: f"(DEBUG) {prefix}%(message)s",
15 logging.INFO: f"{prefix}%(message)s",
16 logging.WARNING: f"{prefix}%(message)s",
17 logging.ERROR: f"{bold_red}{prefix}%(message)s{reset}",
18 logging.CRITICAL: f"{bold_red}{prefix}%(message)s{reset}",
19 }
20
21 def format(self, record):
22 log_fmt = self.FORMATS.get(record.levelno, self.FORMATS[logging.INFO])
23 formatter = logging.Formatter(log_fmt)
24 return formatter.format(record)
25
26
27class AgentOpsLogFileFormatter(logging.Formatter):

Callers 1

configure_loggingFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…