- Install via pip
pip install crewai-logging-patch - Add import into your main crewai file - This needs to be above any other crewai imports
from logger_patch import apply_monkey_patch - Add the patch method to your code - This needs to be above any other crewai imports
apply_monkey_patch() - Add the following directly below your agent instances - You must use your agent names in place of <placeholder_name>
<placeholder_name>._logger = crewai.utilities.Logger(verbose_level=<placeholder_name>.verbose) - And the same below your crew instance, again you must use your crew name in place of <placeholder_name>
<placeholder_name>._logger = crewai.utilities.Logger(verbose_level=<placeholder_name>.verbose) - Ensure that verbose=True is set in your agent and crew instances
- Below is an example crewfile with all of this implemented
import os
from logger_patch import apply_monkey_patch
# Apply the monkey patch
apply_monkey_patch()
# Now use crewai and other imports as usual
from crewai import Agent, Crew, Task, Process
import crewai.utilities
# Setup LM Studio environment variables
os.environ['OPENAI_API_BASE'] = 'http://localhost:1234/v1'
os.environ['OPENAI_API_KEY'] = 'sk-111111111111111111111111111111111111111111111111'
os.environ['OPENAI_MODEL_NAME'] = 'Meta-Llama-3-8B-Instruct-imatrix'
# Create the agent
try:
researcher = Agent(
role='Researcher',
goal='Research the topic',
backstory='As an expert in the field of {topic}, you will research the topic and provide the necessary information',
max_iter=3,
max_rpm=100,
verbose=True,
allow_delegation=False,
)
# Manually set the logger to ensure it's the patched logger
researcher._logger = crewai.utilities.Logger(verbose_level=researcher.verbose)
# Create the task
research_task = Task(
description='Research the topic',
agent=researcher,
expected_output='5 paragraphs of information on the topic',
output_file='research_result.txt',
)
# Create the crew
crew = Crew(
agents=[researcher],
tasks=[research_task],
process=Process.sequential,
verbose=True,
memory=False,
cache=False,
max_rpm=100,
)
# Manually set the logger for crew to ensure it's the patched logger
crew._logger = crewai.utilities.Logger(verbose_level=crew.verbose)
# Start the crew
result = crew.kickoff(inputs={'topic': '70s, 80s and 90s Australian rock bands'})
except Exception as e:
print(f"An error occurred: {e}")
Metadata
Release files for crewai-logging-patch 0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| crewai_logging_patch-0.5.tar.gz | 3.3 kB | Without provenance | Details for crewai_logging_patch-0.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| crewai_logging_patch-0.5-py3-none-any.whl | Python 3 | none | any | Details for crewai_logging_patch-0.5-py3-none-any.whl |
Total release size: 7.1 kB
Release files / crewai_logging_patch-0.5.tar.gz
| Download URL | crewai_logging_patch-0.5.tar.gz |
|---|---|
| Size | 3.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ebefaee304cf2f6c0d75636c81f4012bf5e6fe59dc44d4bc6d5f45f7b1cc33eb
|
|
BLAKE2b-256 checksum How to use checksums |
4dc49657b2c7fcc74b00e2ec7fcf29cc80308035a697f4f5aa7025b7e3469b4e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Release files / crewai_logging_patch-0.5-py3-none-any.whl
| Download URL | crewai_logging_patch-0.5-py3-none-any.whl |
|---|---|
| Size | 3.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
be9a37f478ea50613baeb224722008f8c19c6ab1241e6d4ca3ca6d0fbe224224
|
|
BLAKE2b-256 checksum How to use checksums |
4d0649746cc0930efbb9c16673e6195e082800c3ebe0df209383f862135fa41e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Security for crewai-logging-patch 0.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.