Skip to content

Commit

Permalink
adding logger
Browse files Browse the repository at this point in the history
  • Loading branch information
aarora8 committed Apr 27, 2018
1 parent e951f0a commit e866512
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion egs/madcat_ar/v1/local/create_line_image_from_page_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,17 @@
from scipy.spatial import ConvexHull
from PIL import Image
from scipy.misc import toimage
import logging

sys.path.insert(0, 'steps')
logger = logging.getLogger('libs')
logger.setLevel(logging.INFO)
handler = logging.StreamHandler()
handler.setLevel(logging.INFO)
formatter = logging.Formatter("%(asctime)s [%(pathname)s:%(lineno)s - "
"%(funcName)s - %(levelname)s ] %(message)s")
handler.setFormatter(formatter)
logger.addHandler(handler)

parser = argparse.ArgumentParser(description="Creates line images from page image",
epilog="E.g. " + sys.argv[0] + " data/LDC2012T15"
Expand Down Expand Up @@ -446,7 +457,6 @@ def check_file_location():
if os.path.exists(madcat_file_path3):
return madcat_file_path3, image_file_path3, wc_dict3

print("ERROR: path does not exist")
return None, None, None

def parse_writing_conditions(writing_conditions):
Expand Down

0 comments on commit e866512

Please sign in to comment.