Skip to content

Add logging to Flo library#21

Merged
vizsatiz merged 9 commits intodevelopfrom
flolog
Sep 21, 2024
Merged

Add logging to Flo library#21
vizsatiz merged 9 commits intodevelopfrom
flolog

Conversation

@thomastomy5
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown
Member

@vizsatiz vizsatiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will add more comments later

Comment thread flo_ai/common/flo.log Outdated
Comment thread flo_ai/common/flo_callback_handler.py Outdated
Comment thread flo_ai/common/flo_logger.py Outdated
Comment thread flo_ai/state/flo_session.py Outdated
Comment thread flo_ai/common/flo_logger.py Outdated
vizsatiz
vizsatiz previously approved these changes Sep 17, 2024
Comment thread flo_ai/common/README.md Outdated

FLO_LOG_LEVEL_COMMON: Controls the level for the "CommonLogs" logger.
FLO_LOG_LEVEL_BUILDER: Controls the level for the "BuilderLogs" logger.
FLO_LOG_LEVEL_SESSION: Controls the level for the "SessionLogs" logger.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can add the definition of what commonlogs, builderlogs and sessionlogs are in this readme

Comment thread flo_ai/common/README.md
Comment thread flo_ai/common/README.md Outdated
export FLO_LOG_LEVEL_SESSION=WARNING


2. FloSession Creation:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use markdown subheader ## etc

Comment thread flo_ai/common/README.md
Comment thread flo_ai/common/README.md Outdated
@@ -0,0 +1,67 @@
# Understanding Log Levels
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can probably copy paste this to an AI prompt and make it better markdown

Comment thread flo_ai/common/flo.log Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this file, add the *.log in .gitignore

Comment thread flo_ai/state/flo_session.py Outdated
Comment thread flo_ai/core.py Outdated
def build(session: FloSession, yaml: str):
return Flo(session, to_supervised_team(yaml))
def build(session: FloSession, yaml: str, log_level: str = "INFO"):
FloLogger.set_log_level("BUILDER", log_level)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have to reset it here

Comment thread flo_ai/common/flo_callback_handler.py Outdated
from langchain.schema import AgentAction, AgentFinish, LLMResult
from flo_ai.common.flo_logger import get_logger

class FloCallbackHandler(BaseCallbackHandler):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we have both this and langchain handler ?

@vizsatiz
Copy link
Copy Markdown
Member

@thomastomy5 Overall the design is really good!

@vizsatiz vizsatiz changed the title added logging to Flo library Add logging to Flo library Sep 18, 2024
Comment thread flo_ai/core.py Outdated
self.runnable: ExecutableFlo = build_supervised_team(session, config)

FloLogger.set_log_level("COMMON", log_level)
FloLogger.set_log_level("BUILDER", log_level)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why dont you use set_global_log_level?

Comment thread flo_ai/state/flo_session.py Outdated
vizsatiz
vizsatiz previously approved these changes Sep 21, 2024
Copy link
Copy Markdown
Member

@vizsatiz vizsatiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@vizsatiz vizsatiz merged commit 869b084 into develop Sep 21, 2024
@vizsatiz vizsatiz deleted the flolog branch September 21, 2024 09:17
thomastomy5 added a commit that referenced this pull request Apr 27, 2026
* added logging to Flo library

* added sessionid and option for custom logger

* created common set of loggers and included readmefile for logging

* updated README and changed the config updation location to core

* Minor fixes before merging

* Minor fixes around logging

* Fix for notebooks

* Final fixes to log levels

---------

Co-authored-by: vizsatiz <satis.vishnu@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants