Skip to content

Commit 57c3fef

Browse files
committed
Merge branch 'release/0.8.5'
2 parents 6464156 + 3d5992b commit 57c3fef

File tree

3 files changed

+18
-9
lines changed

3 files changed

+18
-9
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "taskiq"
3-
version = "0.8.4"
3+
version = "0.8.5"
44
description = "Distributed task queue with full async support"
55
authors = ["Pavel Kirilin <[email protected]>"]
66
maintainers = ["Pavel Kirilin <[email protected]>"]

taskiq/cli/scheduler/args.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class SchedulerArgs:
1313
scheduler: Union[str, TaskiqScheduler]
1414
modules: List[str]
1515
log_level: str = LogLevel.INFO.name
16+
configure_logging: bool = True
1617
fs_discover: bool = False
1718
tasks_pattern: str = "tasks.py"
1819

@@ -59,4 +60,10 @@ def from_cli(cls, args: Optional[Sequence[str]] = None) -> "SchedulerArgs":
5960
choices=[level.name for level in LogLevel],
6061
help="scheduler log level",
6162
)
63+
parser.add_argument(
64+
"--no-configure-logging",
65+
action="store_false",
66+
dest="configure_logging",
67+
help="Use this parameter if your application configures custom logging.",
68+
)
6269
return cls(**parser.parse_args(args).__dict__)

taskiq/cli/scheduler/run.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,16 @@ async def run_scheduler(args: SchedulerArgs) -> None: # noqa: C901, WPS210, WPS
8282
exit(1) # noqa: WPS421
8383
scheduler.broker.is_scheduler_process = True
8484
import_tasks(args.modules, args.tasks_pattern, args.fs_discover)
85-
basicConfig(
86-
level=getLevelName(args.log_level),
87-
format=(
88-
"[%(asctime)s][%(levelname)-7s]"
89-
"[%(module)s:%(funcName)s:%(lineno)d]"
90-
" %(message)s"
91-
),
92-
)
85+
if args.configure_logging:
86+
basicConfig(
87+
level=getLevelName(args.log_level),
88+
format=(
89+
"[%(asctime)s][%(levelname)-7s]"
90+
"[%(module)s:%(funcName)s:%(lineno)d]"
91+
" %(message)s"
92+
),
93+
)
94+
getLogger("taskiq").setLevel(level=getLevelName(args.log_level))
9395
for source in scheduler.sources:
9496
await source.startup()
9597
loop = asyncio.get_event_loop()

0 commit comments

Comments
 (0)