Skip to content

Commit

Permalink
add --no-time option to cli
Browse files Browse the repository at this point in the history
  • Loading branch information
adbenitez committed Mar 19, 2024
1 parent 73ceccc commit cf38453
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion matterdelta/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,23 @@
events,
is_not_known_command,
)
from rich.logging import RichHandler

from .api import dc2mb, init_api

cli = BotCli("matterdelta")
cli.add_generic_option(
"--no-time",
help="do not display date timestamp in log messages",
action="store_false",
)


@cli.on_init
def _on_init(bot: Bot, _args: Namespace) -> None:
def _on_init(bot: Bot, args: Namespace) -> None:
bot.logger.handlers = [
RichHandler(show_path=False, omit_repeated_times=False, show_time=args.no_time)
]
for accid in bot.rpc.get_all_account_ids():
if not bot.rpc.get_config(accid, "displayname"):
bot.rpc.set_config(accid, "displayname", "Matterbridge Bot")
Expand Down

0 comments on commit cf38453

Please sign in to comment.