The print goes outside and before the if-statement. Otherwise all you will be able to hook is what you already know.
You NEED containi(), nothing else will work unless you specify parameters to limit how much of the text is read.
Again, I have no idea what messages you want to remove, you have to reproduce them first.