Skip to content

Commit

Permalink
[Fix #1] logger class
Browse files Browse the repository at this point in the history
Allow to print to both stdout and stderr
  • Loading branch information
sundowndev committed Mar 19, 2019
1 parent 2d77b5c commit 5100d6f
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions lib/logger.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
#
# @name : PhoneInfoga - Phone numbers OSINT tool
# @url : https://github.com/sundowndev
# @author : Raphael Cerveaux (sundowndev)

import sys
from lib.args import args

class Logger(object):
def __init__(self):
self.terminal = sys.stdout
self.log = open(args.output.name, "a")

def write(self, message):
self.terminal.write(message)
self.log.write(message)

def flush(self):
# this flush method is needed for python 3 compatibility.
# this handles the flush command by doing nothing.
# you might want to specify some extra behavior here.
pass

0 comments on commit 5100d6f

Please sign in to comment.