Allow logging format strings to use the application globals stored in g. This creates a way to identify the logging records associated with a single request, by including g.start in the log record.
Also, current_user is a proxy which will try to load the current user if it hasn't yet been loaded, which is not something that logging code should be doing, so make a check and only access current_user if it has already been loaded.
Allow logging format strings to use the application globals stored in
g
. This creates a way to identify the logging records associated with a single request, by includingg.start
in the log record.Also,
current_user
is a proxy which will try to load the current user if it hasn't yet been loaded, which is not something that logging code should be doing, so make a check and only accesscurrent_user
if it has already been loaded.