File tree 1 file changed +7
-1
lines changed
packages/jumpstarter/jumpstarter/client 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 2
2
Base classes for drivers and driver clients
3
3
"""
4
4
5
+ import logging
5
6
from contextlib import asynccontextmanager
6
- from dataclasses import dataclass
7
+ from dataclasses import dataclass , field
7
8
8
9
from grpc import StatusCode
9
10
from grpc .aio import AioRpcError , Channel
@@ -40,10 +41,15 @@ class AsyncDriverClient(
40
41
41
42
channel : Channel
42
43
44
+ log_level : str = "INFO"
45
+ logger : logging .Logger = field (init = False )
46
+
43
47
def __post_init__ (self ):
44
48
super ().__post_init__ ()
45
49
jumpstarter_pb2_grpc .ExporterServiceStub .__init__ (self , self .channel )
46
50
router_pb2_grpc .RouterServiceStub .__init__ (self , self .channel )
51
+ self .logger = logging .getLogger (self .__class__ .__name__ )
52
+ self .logger .setLevel (self .log_level )
47
53
48
54
async def call_async (self , method , * args ):
49
55
"""Make DriverCall by method name and arguments"""
You can’t perform that action at this time.
0 commit comments