I've made a decorator named "logger" and I'm using it to show log on the console.
In my python 2.7 everything works fine but in my python 3.7 code, it doesn't print any log in GCP log viewer. (My code is deployed on GCP standard environment)
I've tried to set this code but it doesn't work.
logging.getLogger().setLevel(logging.INFO)
Here's my simple logger decorator
def logger(func):
def wrapper(*args, **kwargs):
logging.info('INSIDE %s PARAMETERS: %s', func.__name__, args)
res = func(*args, **kwargs)
logging.info('OUTSIDE %s OUTPUT: %s', func.__name__, res)
return res
return wrapper
Even a simple logging.info statement is not working.
I've tried everything with logging, but nothing gets printed out on GCP Log Viewer.
logging.info("Text info")
logging.debug("Text debug")
logging.warning("Text warning")
logging.error("Text error")
logging.critical("Text critical")
Here is the log viewer
