Namespace: debug Stay organized with collections Save and categorize content based on your preferences.
rules. debug
debug
debug()
A basic debug function that prints Security Rules language objects, variables and statement results as they are being evaluated by the Security Rules engine. The outputs ofdebug are written to firestore-debug.log.
Thedebug function can only be called inside Rulesconditions.
debug function blocks are only executed by the Security Rules engine in the Firestore emulator, part of the Firebase Emulator Suite. The debug function has no effect in production.
Debug logfile entries are prepended by a string identifying the Rules language data type of the log output (for example,string_value,map_value).
Calls todebug can be nested.
Currently, thedebug feature does not support the concept of logging levels (for example, INFO, WARN, ERROR).
// firestore.rules// Nested debug calls in the following match block....match/carts/{cartID}{allowcreate:ifrequest.auth!=null&&request.auth.uid==request.resource.data.ownerUID;allowread,update,delete:ifdebug(debug(request.auth.uid)==debug(resource.data.ownerUID));}...// firestore-debug.log// ...produce logfile output like the following.string_value:"alice"// for debug(request.auth.uid)string_value:"alice"// for debug(resource.data.ownerUID)bool_value:true// for the outermost enclosing debug() call...
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-06-10 UTC.