improve alert:

- alert_code is now the first argument, and level is now optional
- use constants instead of integers