Were you the one who downvotted me because you disagree? o.O
Anyways, this is dealt with in the logging-as-a-service (LAAS) that receives the logs... say you are using the python logger, you have different types of logging (DEBUG, INFO, WARN, ERR). If you just start the line with one of those statuses, your LAAS will know it should email you or something like that.
The print, or file, or whatever, it's just how your data is getting somewhere for the proper analysis.
You know if it's a new line or not because every log message starts with the same format, something like {APP, TIME, SEVERITY} and then the message...