- Correct asynchronous behavior in the EveAICrewAI classes.
This commit is contained in:
@@ -13,6 +13,26 @@ GRAYLOG_PORT = int(os.environ.get('GRAYLOG_PORT', 12201))
|
||||
env = os.environ.get('FLASK_ENV', 'development')
|
||||
|
||||
|
||||
def pad_string(s, target_length=100, pad_char='-'):
|
||||
"""
|
||||
Pads a string with the specified character until it reaches the target length.
|
||||
|
||||
Args:
|
||||
s: The original string
|
||||
target_length: The desired total length
|
||||
pad_char: Character to use for padding
|
||||
|
||||
Returns:
|
||||
The padded string
|
||||
"""
|
||||
current_length = len(s)
|
||||
if current_length >= target_length:
|
||||
return s
|
||||
|
||||
padding_needed = target_length - current_length - 1
|
||||
return s + " " + (pad_char * padding_needed)
|
||||
|
||||
|
||||
class TuningLogRecord(logging.LogRecord):
|
||||
"""Extended LogRecord that handles both tuning and business event logging"""
|
||||
|
||||
@@ -153,7 +173,7 @@ class TuningLogger:
|
||||
level=level,
|
||||
pathname='',
|
||||
lineno=0,
|
||||
msg=message,
|
||||
msg=pad_string(message, 100, '-'),
|
||||
args=(),
|
||||
exc_info=None
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user