Skip to content

Many logs are printed to stdout directly rather than via logger #117

@enricorotundo

Description

@enricorotundo

There're loads of print statements in the codebase writing to stdout. See example snippet below. This results in a rather verbose output.

2025-02-04 11:53:04,339 - naptha_sdk.client.node - INFO - Node URL: http://node.naptha.ai:7001
2025-02-04 11:53:04,339 - naptha_sdk.inference - INFO - Node URL: http://node.naptha.ai:7001
2025-02-04 11:53:04,339 - naptha_sdk.client.hub - INFO - Hub URL: ws://node.naptha.ai:3001/rpc
Parsed parameters: {'tool_name': 'chat', 'tool_input_data': 'what is an ai agent?'}
2025-02-04 11:53:05,031 - naptha_sdk.client.hub - INFO - Attempting authentication for user: enricorotundo
2025-02-04 11:53:05,181 - naptha_sdk.client.hub - INFO - Successfully authenticated user: enricorotundo
Found user... {'public_key': '..', 'id': 'user:....', 'is_registered': True}
Running Agent...

[...]

Agent run input: {'consumer_id': 'user:...', 'inputs': {'tool_name': 'chat', 'tool_input_data': 'what is an ai agent?'}, 'deployment': {'node': {'ip': 'node.naptha.ai', 'user_communication_port': 7001, 'user_communication_protocol': 'http'}, 'name': None, 'module': {'id': 'agent:simple_chat_agent', 'name': 'simple_chat_agent', 'module_type': 'agent'}, 'config': None, 'data_generation_config': None, 'tool_deployments': [], 'environment_deployments': [], 'kb_deployments': [], 'memory_deployments': []}, 'signature': '.....'}

Ideally, we'd want to use a logger object instead and control the logging level (INFO, DEBUG, etc.) and let user set the desired logging level.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions