Generates a string that is logged in traces. Excludes secrets
329465
public String toLoggableString()
    {
        StringBuilder connectionStringBuilder = new StringBuilder();
        if (this.endpoint != null)
        {
            connectionStringBuilder.append(String.format(Locale.US, "%s%s%s%s", ENDPOINT_CONFIG_NAME, KEY_VALUE_SEPARATOR,
                    this.endpoint.toString(), KEY_VALUE_PAIR_DELIMITER));
        }

        if (!StringUtil.isNullOrWhiteSpace(this.entityPath))
        {
            connectionStringBuilder.append(String.format(Locale.US, "%s%s%s%s", ENTITY_PATH_CONFIG_NAME,
                    KEY_VALUE_SEPARATOR, this.entityPath, KEY_VALUE_PAIR_DELIMITER));
        }
        
        return connectionStringBuilder.toString();
    }
573515
def dump_tracing_state(self, context):
        
        _logger.x_debug("Dumping all threads Tracing state: (%s)" % context)
        _logger.x_debug("    self.tracing_enabled=%s" % self.tracing_enabled)
        _logger.x_debug("    self.execution_started=%s" % self.execution_started)
        _logger.x_debug("    self.status=%s" % self.status)
        _logger.x_debug("    self.frame_beginning=%s" % self.frame_beginning)
        _logger.x_debug("    self.debugger_thread_ident=%s" % self.debugger_thread_ident)
        if False:
            for thr in threading.enumerate():
                is_current_thread = thr.ident == threading.current_thread().ident
                _logger.x_debug("    Thread: %s, %s %s" % (thr.name, thr.ident, "<= Current*" if is_current_thread else ''))
                a_frame = sys._current_frames()[thr.ident]
                while a_frame:
                    flags = []
                    if a_frame == self.frame_beginning:
                        flags.append("beginning")
                    if a_frame == inspect.currentframe():
                        flags.append("current")
                    if flags:
                        flags_str = "**"+",".join(flags)
                    else:
                        flags_str = ""
                    _logger.x_debug("        => %s, %s:%s(%s) | %s %s" % (a_frame, 
                                                                          a_frame.f_code.co_filename, 
                                                                          a_frame.f_lineno,
                                                                          a_frame.f_code.co_name, 
                                                                          a_frame.f_trace,
                                                                          flags_str))
                    a_frame = a_frame.f_back
176464
def logstr(self):
        """"""

        result = []
        formater = LogFormatter(color=False)
        for record in self.logs:
            if isinstance(record, six.string_types):
                result.append(pretty_unicode(record))
            else:
                if record.exc_info:
                    a, b, tb = record.exc_info
                    tb = hide_me(tb, globals())
                    record.exc_info = a, b, tb
                result.append(pretty_unicode(formater.format(record)))
                result.append(u'\n')
        return u''.join(result)
752834
def generate_plaintext_traceback(self):
        """"""
        yield text_('Traceback (most recent call last):')
        for frame in self.frames:
            yield text_('  File "%s", line %s, in %s' % (
                frame.filename,
                frame.lineno,
                frame.function_name
                ))
            yield text_('    ' + frame.current_line.strip())
        yield text_(self.exception)
230365
def log_async_info(kvs, span)
      # Asynchronous spans can persist longer than the parent
      # trace.  With the trace ID, we check the current trace
      # but otherwise, we search staged traces.

      if tracing? && self.current_trace.id == span.context.trace_id
        self.current_trace.add_async_info(kvs, span)
      else
        trace = ::Instana.processor.staged_trace(span.context.trace_id)
        if trace
          trace.add_async_info(kvs, span)
        else
          ::Instana.logger.debug "#{__method__}: Couldn't find staged trace. #{span.inspect}"
        end
      end
    end
188785
protected function generatePaths()
    {
        if ($this->loginPath && !$this->loginCheckPath) {
            foreach ($this->patterns as $pattern) {
                // remove the ^ prefix
                $base = substr($pattern, 1);
                // skip a regex pattern
                if (preg_quote($base) != $base) {
                    continue;
                }
                // now that we found one
                if (substr($base, -1) != '/') {
                    $base .= '/';
                }
                $this->loginCheckPath = $base.'login_check';
                $this->logoutPath     = $base.'logout';
                break;
            }
            // unable to generate since all patterns are regex
            if (!$this->loginCheckPath) {
                static $underscorePad = 0;
                $underscorePad++;
                $this->loginCheckPath = '/'.str_repeat('_', $underscorePad).'login_check';
                $this->logoutPath     = '/'.str_repeat('_', $underscorePad).'logout';
                $this->patterns[]     = "^{$this->loginCheckPath}$";
                $this->patterns[]     = "^{$this->logoutPath}$";
            }
        }
    }
737917
def gen_secret(length=64):
    
    charset = string.ascii_letters + string.digits
    return ''.join(random.SystemRandom().choice(charset)
                   for _ in range(length))
1360680
def random_tracing():
    
    new_id = _uniq_id()
    return Tracing(
        span_id=new_id,
        parent_id=0,
        trace_id=new_id,
        traceflags=0)
414750
function trace() {
      var args = Array.prototype.slice.call(arguments);
      var traceLevel = args.shift();
      if (traceLevel.level & enabledLevels) {
        args.unshift('[' + traceLevel.name + '] ' + new Date().toISOString() + ' - ' + aName + ':');
        console.log.apply(console, args);
      }
    }
428477
public static function debugBacktraceString($trace = null) {
		$result = [];
		if (!\Debug::$debug) return $result;
		$i = 1;
		// if trace is not provided
		if (empty($trace)) {
			$trace = debug_backtrace();
			unset($trace[0]);
		}
		foreach($trace as $v) {
			$stack = '#' . $i . ' ' . (isset($v['file']) ? $v['file'] : 'Unknown');
			if (isset($v['line'])) {
				$stack.= '(' . $v['line'] . ')';
			}
			// do not show error handler
			if (!(isset($v['class']) && $v['class'] == 'error' && $v['function'] == 'error_handler')) {
				$stack.= ': ';
				if(isset($v['class'])) {
					$stack.= $v['class'] . $v['type'];
				}
				$params = [];
				if (isset($v['args'])) {
					foreach ($v['args'] as $v2) {
						if (gettype($v2) == 'string') {
							$params[] = str_replace(["\n", "\r", "\t"], ' ', $v2);
						} else if (is_array($v2)) {
							$temp = var_export_condensed($v2, ['skip_objects' => true]);
							$params[] = substr($temp, 0, 100) . '...';
						} else {
							$params[] = var_export_condensed($v2, ['skip_objects' => true]);
						}
					}
				}
				$stack.= $v['function'] . '(' . implode(', ', $params) . ');';
			}
			$i++;
			$result[] = $stack;
		}
		return $result;
	}
1108085
private function generateSpanName()
    {
        // Try to find the first stacktrace class entry that doesn't start with Google\Cloud\Trace
        foreach (debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS) as $bt) {
            $bt += ['line' => null];
            if (!array_key_exists('class', $bt)) {
                return implode('/', array_filter(['app', basename($bt['file']), $bt['function'], $bt['line']]));
            } elseif (substr($bt['class'], 0, 18) != 'Google\Cloud\Trace') {
                return implode('/', array_filter(['app', $bt['class'], $bt['function'], $bt['line']]));
            }
        }

        // We couldn't find a suitable backtrace entry - generate a random one
        return uniqid('span');
    }
1182080
public function getTraceAsString()
    {
        $remove = "Stack trace:\n";
        $len = strpos($this->_toString, $remove);
        if ($len === false) {
            return '';
        }
        return substr($this->_toString, $len + strlen($remove));
    }
755835
def trace(self, msg, *args, **kwargs):
    
    if self.isEnabledFor(TRACE):
        self._log(TRACE, msg, args, **kwargs)
333624
public function getTraceAsString() {
		$lines = array ();
		for( $i = 0; $i < count($this->trace); $i++ ){
			$a = $this->trace[$i];
			$call = "{$a['function']}()";
			if( isset($a['class']) ){
				$call = "{$a['class']}{$a['type']}$call";
			}
			$lines[] = "#$i {$a['file']}({$a['line']}): $call";
		} 
		$lines[] = "#$i {main}";
		return implode( "\n", $lines );
	}
846024
protected void writeLogging(Definition def, Writer out, int indent, String level, String content, String... params)
         throws IOException
   {
      writeIndent(out, indent);
      if (def.isSupportJbossLogging())
      {
         out.write("log.trace");
         int size = params.length;
         if (size > 0)
            out.write("f");
         out.write("(\"" + content + "(");
         for (int i = 0; i < size; i++)
         {
            out.write("%s");
            if (i < size - 1)
               out.write(", ");
         }
         out.write(")\"");
         for (int i = 0; i < size; i++)
         {
            out.write(", ");
            out.write(params[i]);
         }
         out.write(");");
      }
      else
      {
         out.write("log.finest(\"" + content + "()\");");
      }
      writeEol(out);
   }
859724
def trace(progname = nil, &block)
      if logger.respond_to?(:trace) then
        logger.trace(progname, &block)
      else
        logger.debug(progname, &block)
      end
    end
1017964
def Trace(msg, file=None, mode='w', tstamp=None):
    """"""
    global TraceDefault
    global TimeStampDefault
    global PreviousTime
    if file is None:
        file = TraceDefault
    else:
        TraceDefault = file
    if tstamp is None:
        tstamp = TimeStampDefault
    else:
        TimeStampDefault = tstamp
    try:
        fp = TraceFP[file]
    except KeyError:
        try:
            fp = TraceFP[file] = open(file, mode)
        except TypeError:
            # Assume we were passed an open file pointer.
            fp = file
    if tstamp:
        now = time.time()
        fp.write('%8.4f %8.4f:  ' % (now - StartTime, now - PreviousTime))
        PreviousTime = now
    fp.write(msg)
    fp.flush()
    fp.close()