mirror of
https://github.com/ansible/awx.git
synced 2026-02-15 02:00:01 -03:30
improve readability of the honcho console logs in the dev environment
* colorize uwsgi and celery logs; DEBUG lines are green, WARN lines are yellow, ERROR lines (and tracebacks) are red * pretty-print fact callback receiver JSON * simplify the uwsgi log format so it's more legible
This commit is contained in:
@@ -14,6 +14,7 @@ from celery.contrib.rdb import Rdb
|
||||
|
||||
import cmd
|
||||
import contextlib
|
||||
import logging
|
||||
import os
|
||||
import pprint
|
||||
import re
|
||||
@@ -27,6 +28,8 @@ from pygments import highlight
|
||||
from pygments.lexers import PythonLexer
|
||||
from pygments.formatters import Terminal256Formatter
|
||||
|
||||
logger = logging.getLogger('awx')
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
def style(im_self, filepart=None, lexer=None):
|
||||
@@ -158,6 +161,9 @@ class CustomPdb(Rdb):
|
||||
)
|
||||
return (sock, port)
|
||||
|
||||
def say(self, m):
|
||||
logger.warning(m)
|
||||
|
||||
|
||||
CustomPdb.complete = rlcompleter.Completer(locals()).complete
|
||||
|
||||
|
||||
Reference in New Issue
Block a user