All applications we produce MUST output their logs in ECS compatible ndJSON format by default. They MAY additionally have ENV variable support for changing to a format that developers consider better for local development.
You can use https://github.com/trentm/go-ecslog to pretty-print the ECS logs.
https://github.com/pvarki/python-libpvarki provides easy logging init that you can use to achieve the requirements.
Elastic also provides package called ecs-logging if for some reason you cannot use the common init.
Until we have libpvarki for JS you can use Elastic provided formatters to format outputs from popular loggers to be ECS compatible.