Skip to content

Commit

Permalink
final commit🙏🏽
Browse files Browse the repository at this point in the history
  • Loading branch information
Abodi-Massarwa committed Aug 8, 2024
1 parent 993a960 commit 1268cb7
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
import base64

logger = logging.getLogger(__name__)
# Create a string stream to capture logs
log_stream = io.StringIO()


def per_category_round_robin(alloc: AllocationBuilder, item_categories: dict[str,list], agent_category_capacities: dict[str,dict[str,int]],
initial_agent_order: list,callback:callable=None):
Expand Down Expand Up @@ -1272,13 +1271,16 @@ def helper_generate_bipartite_graph_base64(graph,iteration:int,category:str):
return base64.b64encode(img_bytes.read()).decode('utf-8')

def helper_configure_logger():
# Create a string stream to capture logs
log_stream = io.StringIO()
stream_handler = logging.StreamHandler(log_stream)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
logger.addHandler(stream_handler)
stream_handler.setFormatter(formatter)
logger.setLevel(logging.DEBUG)
return log_stream

def helper_get_logs():
def helper_get_logs(log_stream):
return log_stream.getvalue()

if __name__ == "__main__":
Expand Down

0 comments on commit 1268cb7

Please sign in to comment.