autogen icon indicating copy to clipboard operation
autogen copied to clipboard

Custom Runtime Logger

Open Hk669 opened this issue 1 year ago • 8 comments

Why are these changes needed?

To support custom logger for the developers.

Related issue number

Issues : #2581

Tasks

  • [ ] add the __init__ for the BaseLogger to define the session_id.
  • [ ] add the file log functionality to write the logs into a file.

Checks

  • [ ] I've included any doc changes needed for https://microsoft.github.io/autogen/. See https://microsoft.github.io/autogen/docs/Contribute#documentation to build and test documentation locally.
  • [ ] I've added tests (if relevant) corresponding to the changes introduced in this PR.
  • [ ] I've made sure all auto checks have passed.

Hk669 avatar May 05 '24 10:05 Hk669

Codecov Report

Attention: Patch coverage is 70.70707% with 29 lines in your changes are missing coverage. Please review.

Project coverage is 42.89%. Comparing base (372ac1e) to head (afabe32). Report is 23 commits behind head on main.

Files Patch % Lines
autogen/logger/file_logger.py 71.59% 21 Missing and 4 partials :warning:
autogen/logger/logger_factory.py 60.00% 2 Missing :warning:
autogen/runtime_logging.py 66.66% 1 Missing and 1 partial :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2596      +/-   ##
==========================================
+ Coverage   33.11%   42.89%   +9.78%     
==========================================
  Files          86       87       +1     
  Lines        9108     9336     +228     
  Branches     1938     2139     +201     
==========================================
+ Hits         3016     4005     +989     
+ Misses       5837     4958     -879     
- Partials      255      373     +118     
Flag Coverage Δ
unittest 12.70% <29.29%> (?)
unittests 42.19% <70.70%> (+9.07%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar May 05 '24 10:05 codecov-commenter

@ekzhu do we need different files for logs? as we have a different tables in SqliteLogger.

Hk669 avatar May 05 '24 10:05 Hk669

added some functionalities, any reviews or looks good? can i go ahead with the implementation. Thanks

@ekzhu @sonichi @cheng-tan

Hk669 avatar May 05 '24 11:05 Hk669

@ekzhu @jackgerrits , the issue, ive been facing is. when testing it is adding the duplicate logs. can you help me out. Thanks

Hk669 avatar May 07 '24 13:05 Hk669

@ekzhu @jackgerrits , the issue, ive been facing is. when testing it is adding the duplicate logs. can you help me out. Thanks

this is addressed in the below commit

Hk669 avatar May 07 '24 19:05 Hk669

@ekzhu do we need different files for logs? as we have a different tables in SqliteLogger.

I think a single file is sufficient for a built-in logger.

ekzhu avatar May 07 '24 20:05 ekzhu

when testing it is adding the duplicate logs.

Can you expand this a bit more with an example?

ekzhu avatar May 07 '24 20:05 ekzhu

when testing it is adding the duplicate logs.

Can you expand this a bit more with an example?

this is solved.

Hk669 avatar May 07 '24 20:05 Hk669

[file_logger] Failed to log event Object of type OpenAIWrapper is not JSON serializable

@ekzhu @jackgerrits @sonichi , how can i solve this error? ive used the to_dict and also the json.dumps

Hk669 avatar May 08 '24 14:05 Hk669

@ekzhu @sonichi @WaelKarkoub @jackgerrits please review the changes.

Hk669 avatar May 09 '24 15:05 Hk669

@ekzhu implemented the tests using tempfile, but the windows build tests are failed, can you please look into the issue. Thanks

cc @sonichi @krishnashed @WaelKarkoub

Hk669 avatar May 14 '24 11:05 Hk669