remove some logging functions

This commit is contained in:
Sebastian Bachmann 2017-11-24 10:25:43 +01:00
parent 2f509fa70e
commit cab43f251a
4 changed files with 4 additions and 33 deletions

View File

@ -47,9 +47,6 @@ class AndroTest(auto.DirectoryAndroAnalysis):
def main(options, arguments):
if options.verbose:
set_debug()
if options.directory:
settings = {
"my": AndroTest(options.directory),

View File

@ -187,11 +187,6 @@ def str2long(s):
return l
def random_string():
return random.choice(string.letters) + ''.join([random.choice(
string.letters + string.digits) for i in range(10 - 1)])
def is_android(filename):
"""Return the type of the file
@ -235,19 +230,9 @@ def is_android_raw(raw):
# Init Logger
logger = logging.getLogger("androguard.runtime") # logs at runtime
def set_lazy():
CONF["LAZY_ANALYSIS"] = True
def set_debug():
logger.setLevel(logging.DEBUG)
def set_info():
logger.setLevel(logging.INFO)
# By default this logger will now be shown to the outer world (e.g. stdout)
# but you can use `show_logging()` to activate it.
logger = logging.getLogger("androguard")
def show_logging(level=logging.INFO):
@ -255,7 +240,7 @@ def show_logging(level=logging.INFO):
enable log messages on stdout
"""
h = logging.StreamHandler(stream=sys.stdout)
h.setFormatter(logging.Formatter(fmt="%(asctime)s [%(levelname)-9s] %(name)s: %(message)s"))
h.setFormatter(logging.Formatter(fmt="%(asctime)s [%(levelname)-9s] %(name)s (%(filename)s): %(message)s"))
logger.addHandler(h)
logger.setLevel(level)
@ -298,11 +283,6 @@ def set_options(key, value):
CONF[key] = value
def save_to_disk(buff, output):
with open(output, "w") as fd:
fd.write(buff)
def rrmdir(directory):
for root, dirs, files in os.walk(directory, topdown=False):
for name in files:

View File

@ -18,9 +18,6 @@ if __name__ == '__main__':
args = parser.parse_args()
if args.debug:
androconf.set_debug()
# We need that to save huge sessions when leaving and avoid
# RuntimeError: maximum recursion depth exceeded while pickling an object
# or

View File

@ -59,9 +59,6 @@ def interact():
def main(options, arguments):
if options.debug:
set_debug()
if options.shell is not None:
interact()