I'm configuring Python logging in my Google Cloud function.
# Imports the Cloud Logging client library
import google.cloud.logging
# Instantiates a client
logclient = google.cloud.logging.Client()
# Imports Python logging module
import logging
# Retrieves a Cloud Logging handler based on the environment
# you're running in and integrates the handler with the
# Python logging module. By default this captures all logs
# at INFO level and higher
logclient.get_default_handler()
logclient.setup_logging(log_level=logging.INFO)
And this is the logging line:
logging.info(f'Creating invoice for {entity_id}')
There are no other logging lines of code with that message in this Google Cloud function.
The function itself finishes successfully without any errors.
The logs appear successfully when viewed in Google Cloud Console.
However, it is written as two entries, same timestamp etc, only differing in severity:
- INFO: which is the correct level I'm logging at
- ERROR: why is this appearing?