DRC can have many forms. The Nazca DRC is mostly aimed the netlist or logical connection level.
(For polygon level on the gds, DRC in Klayout can help out in a next step.)
Below an example of the Nazca DRC that defines xsections, layers, a building block, some interconnects and then connects them having different pin xsections and/or widths. This will trigger a DRC error. This will be displayed to stdout but a logfile can be added, as in this example, to store the DRC error messages.
DRC violations are added to the logfile and visualized in the layout. If you want to find out where in your script a DRC error was caused, you can ask Nazca to raise an exception on the specific error number by changing the third line in the above code to nd.pin2pin_drc_on(num=0) (for error DRC-0). Use standard Python traceback to find where in your script the eroor originated.