Add more logging and make logging context clearer
This is now actually useful if you want to debug why your swagger YAML isn't producing a table you think it should be.
This commit is contained in:
parent
f1adad5fb3
commit
6afdfc0771
3 changed files with 34 additions and 8 deletions
|
@ -22,7 +22,11 @@ class Units(object):
|
|||
|
||||
def log(self, text):
|
||||
if self.debug:
|
||||
print "batesian:units: %s" % text
|
||||
func_name = ""
|
||||
trace = inspect.stack()
|
||||
if len(trace) > 1 and len(trace[1]) > 2:
|
||||
func_name = trace[1][3] + ":"
|
||||
print "batesian:units:%s %s" % (func_name, text)
|
||||
|
||||
def get_units(self, debug=False):
|
||||
unit_list = inspect.getmembers(self, predicate=inspect.ismethod)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue