import logging
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
#
# # create a file handler
handler = logging.FileHandler('hello.log')
handler.setLevel(logging.INFO)
#
# create a logging format
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
handler.setFormatter(formatter)

# add the handlers to the logger
logger.addHandler(handler)

# logger.info('Hello baby')

# logging.basicConfig(filename="logger.log",level=logging.DEBUG)


# print "log"
# logging.debug("added")

# myapp.py
# import logging
#
#
# def main():
#     logging.basicConfig(filename='myapp.log', level=logging.INFO)
#     logging.info('Started')
#     print "do sime "
#     logging.info('Finished')
#
# if __name__ == '__main__':
#     main()
