'What I\'m going to do is:
- inspect the stack and try to find a reference to a plugin
- if a plugin is the caller, then i\'ll return something like audit.xss
- if no plugin is in the caller stack, i\'ll return the stack item
specified by which_stack_item
Maybe you are asking yourself why which_stack_item == 4, well, this is
why:
I know that get_caller method will be in the stack
I also know that the method that calls get_caller will be in stack
I also know that the om.out.XYZ method will be in the stack
That\'s 3... so... number 4 is the one that really called me.
:return: The caller of the om.out.XYZ method; this is used to make
output more readable.
>>> bop = OutputPlugin()
>>> bop.get_caller()
\'doctest\''

def get_caller(self, which_stack_item=4):

    try:
        the_stack = inspect.stack()
        for item in the_stack:
            if item[1].startswith('plugins/'):
                res = item[1].replace('plugins/', '')
                res = res.replace('/', '.')
                return res.replace('.py', '')
        else:
            item = the_stack[which_stack_item]
            res = item[1].split('/')[(-1):][0]
            return res.replace('.py', '')
    except Exception:
        return 'unknown-caller'
