Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
HELpy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hive
HELpy
Commits
58e0bf71
Commit
58e0bf71
authored
2 weeks ago
by
Krzysztof Mochocki
Browse files
Options
Downloads
Patches
Plain Diff
Fix passing of logger to handle
parent
715118d3
No related branches found
No related tags found
1 merge request
!76
Test hot fix
Pipeline
#118226
canceled
2 weeks ago
Stage: static_code_analysis
Stage: build
Stage: beekeepy
Changes
2
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
beekeepy/beekeepy/_remote_handle/abc/handle.py
+5
-4
5 additions, 4 deletions
beekeepy/beekeepy/_remote_handle/abc/handle.py
beekeepy/beekeepy/_runnable_handle/beekeeper.py
+1
-1
1 addition, 1 deletion
beekeepy/beekeepy/_runnable_handle/beekeeper.py
with
6 additions
and
5 deletions
beekeepy/beekeepy/_remote_handle/abc/handle.py
+
5
−
4
View file @
58e0bf71
...
...
@@ -3,7 +3,7 @@ from __future__ import annotations
from
abc
import
ABC
,
abstractmethod
from
typing
import
TYPE_CHECKING
,
Any
,
Generic
,
TypeVar
from
loguru
import
logger
from
loguru
import
logger
as
loguru_logger
from
beekeepy._communication.aiohttp_communicator
import
AioHttpCommunicator
from
beekeepy._communication.request_communicator
import
RequestCommunicator
...
...
@@ -35,6 +35,7 @@ class AbstractHandle(UniqueSettingsHolder[Settings], ABC, Generic[ApiT]):
self
,
*
args
:
Any
,
settings
:
Settings
,
logger
:
Logger
|
None
=
None
,
**
kwargs
:
Any
,
)
->
None
:
"""
Constructs handle to network service.
...
...
@@ -44,7 +45,7 @@ class AbstractHandle(UniqueSettingsHolder[Settings], ABC, Generic[ApiT]):
communicator: communicator class to use for communication
"""
super
().
__init__
(
*
args
,
settings
=
settings
,
**
kwargs
)
self
.
__logger
=
self
.
__configure_logger
()
self
.
__logger
=
self
.
__configure_logger
(
logger
)
self
.
__overseer
=
self
.
settings
.
get_overseer
(
communicator
=
(
self
.
settings
.
try_get_communicator_instance
()
or
self
.
_get_recommended_communicator
())
)
...
...
@@ -112,9 +113,9 @@ class AbstractHandle(UniqueSettingsHolder[Settings], ABC, Generic[ApiT]):
assert
isinstance
(
serialized_data
,
JSONRPCResult
)
return
serialized_data
def
__configure_logger
(
self
)
->
Logger
:
def
__configure_logger
(
self
,
logger
:
Logger
|
None
)
->
Logger
:
# credit for lazy=True: https://github.com/Delgan/loguru/issues/402#issuecomment-2028011786
return
logger
.
opt
(
lazy
=
True
).
bind
(
**
self
.
_logger_extras
())
return
(
logger
or
loguru_logger
)
.
opt
(
lazy
=
True
).
bind
(
**
self
.
_logger_extras
())
def
teardown
(
self
)
->
None
:
self
.
_overseer
.
teardown
()
...
...
This diff is collapsed.
Click to expand it.
beekeepy/beekeepy/_runnable_handle/beekeeper.py
+
1
−
1
View file @
58e0bf71
...
...
@@ -58,7 +58,7 @@ class AsyncRemoteBeekeeper(remote_beekeeper.AsyncBeekeeper):
class
BeekeeperCommon
(
BeekeeperNotificationCallbacks
,
ABC
):
def
__init__
(
self
,
*
args
:
Any
,
settings
:
Settings
,
logger
:
Logger
,
**
kwargs
:
Any
)
->
None
:
super
().
__init__
(
*
args
,
settings
=
settings
,
**
kwargs
)
super
().
__init__
(
*
args
,
settings
=
settings
,
logger
=
logger
,
**
kwargs
)
self
.
__exec
=
BeekeeperExecutable
(
settings
,
logger
)
self
.
__notification_server
:
UniversalNotificationServer
|
None
=
None
self
.
__notification_event_handler
:
NotificationHandler
|
None
=
None
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment