Add "set_log_level" to python wrapper

This commit is contained in:
Richard van der Hoff 2016-09-22 16:20:36 +01:00
parent 9001d3520a
commit 5e4cb07095
3 changed files with 11 additions and 0 deletions

View file

@ -1,4 +1,5 @@
from .account import Account from .account import Account
from .account import set_log_level
from .session import Session from .session import Session
from .outbound_group_session import OutboundGroupSession from .outbound_group_session import OutboundGroupSession
from .inbound_group_session import InboundGroupSession from .inbound_group_session import InboundGroupSession

View file

@ -13,6 +13,8 @@ from . import *
def build_arg_parser(): def build_arg_parser():
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument("--key", help="Account encryption key", default="") parser.add_argument("--key", help="Account encryption key", default="")
parser.add_argument("--log-level", help="Log level", type=int, default=None)
commands = parser.add_subparsers() commands = parser.add_subparsers()
create_account = commands.add_parser("create_account", help="Create a new account") create_account = commands.add_parser("create_account", help="Create a new account")
@ -344,4 +346,7 @@ def do_group_decrypt(args):
if __name__ == '__main__': if __name__ == '__main__':
parser = build_arg_parser() parser = build_arg_parser()
args = parser.parse_args() args = parser.parse_args()
if args.log_level is not None:
set_log_level(args.log_level)
args.func(args) args.func(args)

View file

@ -2,6 +2,11 @@ import json
from ._base import * from ._base import *
lib.olm_set_log_level.argtypes = [c_uint]
lib.olm_set_log_level.restype = None
set_log_level = lib.olm_set_log_level
lib.olm_account_size.argtypes = [] lib.olm_account_size.argtypes = []
lib.olm_account_size.restype = c_size_t lib.olm_account_size.restype = c_size_t