added logger to all subclasses, and added exception handling for structure creation

This commit is contained in:
Nicholas St. Germain 2018-12-06 11:39:51 -06:00
parent b27066a213
commit 59bfb4a567
4 changed files with 35 additions and 8 deletions

View file

@ -1,3 +1,4 @@
import logging
from requests import Session, Request
from datetime import datetime, timezone
@ -13,6 +14,7 @@ class OmbiAPI(object):
# Create session to reduce server web thread load, and globally define pageSize for all requests
self.session = Session()
self.session.headers = {'Apikey': self.server.api_key}
self.logger = logging.getLogger()
def __repr__(self):
return "<ombi-{}>".format(self.server.id)