@@ -22,7 +22,7 @@ def __init__(self, redisBinaryPath, port=6379, modulePath=None, moduleArgs=None,
2222 dbDirPath = None , useSlaves = False , serverId = 1 , password = None , libPath = None , clusterEnabled = False , decodeResponses = False ,
2323 useAof = False , useRdbPreamble = True , debugger = None , sanitizer = None , noCatch = False , noLog = False , unix = False , verbose = False , useTLS = False ,
2424 tlsCertFile = None , tlsKeyFile = None , tlsCaCertFile = None , clusterNodeTimeout = None , tlsPassphrase = None , enableDebugCommand = False , protocol = 2 ,
25- terminateRetries = None , terminateRetrySecs = None ):
25+ terminateRetries = None , terminateRetrySecs = None , loglevel = None ):
2626 self .uuid = uuid .uuid4 ().hex
2727 self .redisBinaryPath = os .path .expanduser (redisBinaryPath ) if redisBinaryPath .startswith (
2828 '~/' ) else redisBinaryPath
@@ -42,6 +42,7 @@ def __init__(self, redisBinaryPath, port=6379, modulePath=None, moduleArgs=None,
4242 self .sanitizer = sanitizer
4343 self .noCatch = noCatch
4444 self .noLog = noLog
45+ self .loglevel = loglevel
4546 self .environ = os .environ .copy ()
4647 self .useUnix = unix
4748 self .dbDirPath = dbDirPath
@@ -205,6 +206,8 @@ def createCmdArgs(self, role):
205206 cmdArgs += ['--logfile' , '/dev/null' ]
206207 elif self .outputFilesFormat is not None and not self .noCatch :
207208 cmdArgs += ['--logfile' , self ._getFileName (role , '.log' )]
209+ if self .loglevel is not None :
210+ cmdArgs += ['--loglevel' , self .loglevel ]
208211 if self .outputFilesFormat is not None :
209212 cmdArgs += ['--dbfilename' , self ._getFileName (role , '.rdb' )]
210213 if role == SLAVE :
0 commit comments