How to implement brown out detector arduino ESP32?
The ESP32's on-board BOD is mainly intended to inhibit operations that might cause corruption if they happened with too low a voltage.  There is a very unpredictable amount of time for the code in the ESP32 to do anything but effectively halt.
If that's what you want, then you have enabled it in your code above.
If you want to detect a power outage, for example, and log something, then you need two things:

A reliable detector that the power has failed.
A battery or capacitor-based circuit that will continue the ESP32's power for long enough for you to do what you need to do.

So when &quot;1&quot; happens you set a GPIO pin on the ESP32 which triggers your interrupt and you do what you need to do while the power remains stable.