Skip to content

Commit

Permalink
Update log handling in Command class for improved clarity and default…
Browse files Browse the repository at this point in the history
… behavior
  • Loading branch information
grongierisc committed Jan 15, 2025
1 parent b7a4388 commit b4e0312
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/iop/_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,10 @@ def _handle_migrate(self) -> None:
_Utils.migrate(migrate_path)

def _handle_log(self) -> None:
log_name = _Director.get_default_production() if self.args.log == 'not_set' else self.args.log
print(_Director.get_production_log(log_name))
if self.args.log == 'not_set':
print(_Director.log_production_top())
else:
print(_Director.log_production(self.args.log))

def _handle_init(self) -> None:
_Utils.setup(None)
Expand Down
2 changes: 1 addition & 1 deletion src/iop/_director.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ async def _log_production_async(handler):
await asyncio.sleep(1)

@staticmethod
def log_production_top(top):
def log_production_top(top=10):
"""
Log the top N logs of the production
Parameters:
Expand Down

0 comments on commit b4e0312

Please sign in to comment.