Skip to content

remove newlines from datastore Key.toString() values #1112

@mattnworb

Description

@mattnworb

Calling .toString() on a datastore Key, for instance when logging some value or operation in application code, returns a String containing newlines and tabs, which might be too verbose in places where each "log line" is expected to be a single line.

For instance:

partition_id {
  project_id: "some-project-id"
}
path {
  kind: "taskqueue"
  id: -1037827333
}

Since the toString implemented in BaseKey is converting the instance to protobuf and calling toString on the returned GeneratedMessage, could one of the protobuf methods for formatting without newlines be used instead for condensed output?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions