abstracted method for alert printing