How to trigger newlines in log messages?
It's the same as any other string. Either use non-standard E'' strings to tell PostgreSQL you want escape processing:

RAISE WARNING E'Line 1\nLine 2';


or use SQL-standard strings with literal newlines:

RAISE WARNING 'Line 1
Line 2';