Skip to main content

set_level

Set the minimum level of messages to be recorded, and return True if the level was recorded successfully.

If set to None, use the default level (see the get_level() function).

def set_level(
request: HttpRequest,
level: integer|null
) - > boolean

Set the minimum level of messages to be recorded, and return True if the level was recorded successfully. If set to None, use the default level (see the get_level() function).

Parameters

NameTypeDescription
requestHttpRequestThe current HTTP request object which must have a message storage backend initialized
level`integernull`

Returns

TypeDescription
booleanTrue if the message level was successfully updated on the request object, False if the request lacks a message storage backend