def send(string='', verbosity=1):    
    global base_stack_level, lastmsg, stdopt, filopt
#    if string==lastmsg:
#       return
    
    if verbosity <= filopt['verbosity'] or verbosity <= stdopt['verbosity']:
        if stdopt['showCaller'] or filopt['showCaller']:
            if len(stack()) <= base_stack_level or base_stack_level == -1:
                base_stack_level = len(stack())
        
            curr_lev = len(stack()) - base_stack_level        
            caller = inspect.stack()[1][3]
        else:
            caller=''
            curr_lev=0

        if stdopt['showCallerStack'] or filopt['showCallerStack']:
            callerstack = getStackPath()[2:]
            if 'runcode' in callerstack:
                del(callerstack[callerstack.index('runcode'):])
            if 'runfile' in callerstack:
                del(callerstack[callerstack.index('runfile'):])
            callerstack = str(callerstack).strip('[]').replace(', ','.').replace('\'','')
        else:
            callerstack=''
        
        if verbosity <= filopt['verbosity']:
            try:
                outstr_file = makeLogString(string, filopt, caller, callerstack, curr_lev)
                logfile.write(outstr_file+'\n')
            except:
                pass

        if verbosity <= stdopt['verbosity']:
            outstr_std = makeLogString(string, stdopt, caller, callerstack, curr_lev)        
            print(colorize(outstr_std))

    lastmsg = string
dataset/ETHPy150Open franapoli/pyleaf/pyleaf/log.py/send/original