def _handle_sigusr1(sig, stack):
 if sys.stderr.isatty():
  output = sys.stderr
  _makepretty(output, stack)
 else:
  filename = 'salt-debug-{0}.log'.format(int(time.time()))
  destfile = os.path.join(tempfile.gettempdir(), filename)
  with salt.utils.fopen(destfile, 'w') as output:
   _makepretty(output, stack)

def _handle_sigusr1 ( sig , stack ) : if sys . stderr . isatty ( ) : output = sys . stderr _makepretty ( output , stack ) else : filename = 'salt-debug-{0}.log' . format ( int ( time . time ( ) ) ) destfile = os . path . join ( tempfile . gettempdir ( ) , filename ) with salt . utils . fopen ( destfile , 'w' ) as output : _makepretty ( output , stack )
signal handler for sigusr1 .