Related with #3359. To make it easier to set the labels in each request without explicitly calling handler.get_gae_labels() or calling client.setup_logging() inside the request which causes a lot overhead, it's better to move the code path of getting the gae labels to the emit() function in the logging handler. And change the AppEngineHandler to extend the logging.StreamHandler directly instead of extending the CloudLoggingHandler.
Related with #3359. To make it easier to set the labels in each request without explicitly calling
handler.get_gae_labels()or callingclient.setup_logging()inside the request which causes a lot overhead, it's better to move the code path of getting the gae labels to theemit()function in the logging handler. And change theAppEngineHandlerto extend thelogging.StreamHandlerdirectly instead of extending theCloudLoggingHandler.