Put one of the wires through a toroidal inductor, and you've made a current transformer, with a primary winding of one turn and a secondary winding of the number of turns on that inductor.
current transformers are usually terminated with a low-Ohm resistor, and often have warnings that the load resistors should never be disconnected, as that could lead to high output voltages, so that is ideal for your application.
You will need to have an inductor that works with 50Hz (or 60Hz).
Also, keep a bit of safety in mind. Use the "double isolated" approach by starting with wire that is already double isolated and fit for your mains voltage, and then just use one of the cores of that wire and do not connect the other wire at all. Use a separate piece of wire for the other conductor of the mains voltage and do not put that wire through the inductor core.. When in doubt, add another layer of heat shrink and use decent connectors for anything mains related.
With this you can probably extract enough energy to keep a LIR2032 or similar topped up, but it depends on the other side also. You only have an output when there is current flowing through the inductor, so if the thing you want to monitor is only turned on for brief amounts of time you have less energy for your gadget, and good power management becomes a more important issue.
If the thing you want to check only draws a low current, then use multiple primary windings for the primary winding of your transformer. If the wire you use is not rated for the Amperage of your mains socket, you also need to add a fuse.