How to use the oletools.common.log_helper.log_helper function in oletools

To help you get started, we’ve selected a few oletools examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github decalage2 / oletools / tests / common / log_helper / log_helper_test_main.py View on Github external
use_json = 'as-json' in args
    throw = 'throw' in args
    percent_autoformat = '%-autoformat' in args

    if 'enable' in args:
        log_helper.enable_logging(use_json, level, stream=sys.stdout)

    _log()

    if percent_autoformat:
        logger.info('The %s is %d.', 'answer', 47)

    if throw:
        raise Exception('An exception occurred before ending the logging')

    log_helper.end_logging()
github decalage2 / oletools / oletools / msodde.py View on Github external
text = ''
    return_code = 1
    try:
        text = process_maybe_encrypted(
            args.filepath, args.password,
            field_filter_mode=args.field_filter_mode)
        return_code = 0
    except Exception as exc:
        logger.exception(str(exc))

    logger.print_str('DDE Links:')
    for link in text.splitlines():
        logger.print_str(text, type='dde-link')

    log_helper.end_logging()

    return return_code