Search code examples
google-cloud-platformgoogle-cloud-logging

Preserve Indentation in GCP Logs


Is there a way to preserve the indentation of lines in GCP logs?

I have a hard time reading scopes when every line is at the same level visually. Below is a screenshot of an example:

GCP logs lacking indentation


Solution

  • The logs actually do preserve indentation, as Srividya pointed out.

    I've since edited my code, but I believe this was the result of JSON.stringify or some sort of string conversion function that did not preserve tabs when I printed an object.