15
15
# specific language governing permissions and limitations
16
16
# under the License.
17
17
import typing
18
+ import warnings
18
19
19
20
from selenium .webdriver .common import service
20
21
@@ -28,7 +29,7 @@ class Service(service.Service):
28
29
:param executable_path: install path of the WebKitWebDriver executable, defaults to `WebKitWebDriver`.
29
30
:param port: Port for the service to run on, defaults to 0 where the operating system will decide.
30
31
:param service_args: (Optional) List of args to be passed to the subprocess when launching the executable.
31
- :param log_path : (Optional) File path for the file to be opened and passed as the subprocess stdout/stderr handler.
32
+ :param log_output : (Optional) File path for the file to be opened and passed as the subprocess stdout/stderr handler.
32
33
:param env: (Optional) Mapping of environment variables for the new process, defaults to `os.environ`.
33
34
"""
34
35
@@ -37,16 +38,20 @@ def __init__(
37
38
executable_path : str = DEFAULT_EXECUTABLE_PATH ,
38
39
port : int = 0 ,
39
40
log_path : typing .Optional [str ] = None ,
41
+ log_output : typing .Optional [str ] = None ,
40
42
service_args : typing .Optional [typing .List [str ]] = None ,
41
43
env : typing .Optional [typing .Mapping [str , str ]] = None ,
42
44
** kwargs ,
43
45
) -> None :
44
46
self .service_args = service_args or []
45
- log_file = open (log_path , "wb" ) if log_path else None
47
+ if log_path is not None :
48
+ warnings .warn ("log_path is deprecated, use log_output instead" , DeprecationWarning , stacklevel = 2 )
49
+ log_path = open (log_path , "wb" )
50
+ log_output = open (log_output , "wb" ) if log_output else None
46
51
super ().__init__ (
47
52
executable_path = executable_path ,
48
53
port = port ,
49
- log_file = log_file ,
54
+ log_output = log_path or log_output ,
50
55
env = env ,
51
56
** kwargs ,
52
57
)
0 commit comments