File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -1551,6 +1551,9 @@ def _encode(self, value):
1551
1551
value = value .encode ('utf-8' , 'strict' )
1552
1552
return value
1553
1553
1554
+ def _log (self , level , msg ):
1555
+ pass
1556
+
1554
1557
1555
1558
def get_total_milliseconds (td ):
1556
1559
return int ((td .days * 24 * 60 * 60 + td .seconds ) * 1000 + td .microseconds / 1000.0 )
Original file line number Diff line number Diff line change
1
+ import logging
1
2
import sys
2
3
import threading
3
4
try :
@@ -61,7 +62,12 @@ def _call(*call_args):
61
62
lua_globals .redis = {"call" : _call ,
62
63
# TODO wrap _call with try to implement "pcall": _pcall,
63
64
"status_reply" : lambda status : self ._python_to_lua ({"ok" : status }),
64
- "error_reply" : lambda error : self ._python_to_lua ({"err" : error })
65
+ "error_reply" : lambda error : self ._python_to_lua ({"err" : error }),
66
+ "log" : client ._log ,
67
+ "LOG_DEBUG" : logging .DEBUG ,
68
+ "LOG_VERBOSE" : logging .INFO ,
69
+ "LOG_NOTICE" : logging .WARNING ,
70
+ "LOG_WARNING" : logging .ERROR
65
71
}
66
72
return self ._lua_to_python (lua .execute (self .script ), return_status = True )
67
73
You can’t perform that action at this time.
0 commit comments