String _createLogEntry()

in google_cloud/lib/src/logging.dart [243:259]


String _createLogEntry(
  String? traceValue,
  Object message,
  LogSeverity severity, {
  Frame? stackFrame,
}) {
  // https://cloud.google.com/logging/docs/agent/logging/configuration#special-fields
  final logContent = {
    'message': message,
    'severity': severity,
    // 'logging.googleapis.com/labels': { }
    if (traceValue != null) 'logging.googleapis.com/trace': traceValue,
    if (stackFrame != null)
      'logging.googleapis.com/sourceLocation': _sourceLocation(stackFrame),
  };
  return jsonEncode(logContent);
}