How to sort drush status messages in test scripts? I'm using drush to run test scripts agains my drupal 7 installation. Simply calling:

$ drush scr path/to/myScript.php


My script is using drupal_set_message() to output status of my test scripts.

My problem is the output is sorted by importance, like that:

Test 1339 failed.                [error]
Test 1338 failed.                [error]
Something strange happened!      [warning]
Test 1337 successful.            [status]
Script starting.                 [notice]
Script finished after 1234ms.    [notice]


Is there any way to sort the output of the messages by the time they get called in my script, it would look much more logical like that:

Script starting.                 [notice]
Test 1337 successful.            [status]
Test 1338 failed.                [error]
Something strange happened!      [warning]
Test 1339 failed.                [error]
Script finished after 1234ms.    [notice]


Is that possible somehow? Is drupal_set_message() the wrong approach? Any suggestions?
You can log your debugging messages in database using watchdog
 and you will find the logged message in order at "admin/reports/dtblog"

Updated:
Check the document page, as for [status] , watchdog has $severity parameter to set the status for your message.Following values can be set as status for the logged message.

WATCHDOG_EMERGENCY: Emergency, system is unusable.
WATCHDOG_ALERT: Alert, action must be taken immediately.
WATCHDOG_CRITICAL: Critical conditions.
WATCHDOG_ERROR: Error conditions.
WATCHDOG_WARNING: Warning conditions.
WATCHDOG_NOTICE: (default) Normal but significant conditions.
WATCHDOG_INFO: Informational messages.
WATCHDOG_DEBUG: Debug-level messages.


As a simple example, check this

 watchdog('your_script_name', '!message', array('!message' =&gt; "something_happened"), WATCHDOG_ERROR);


the above will log message when called keeping severity as "error".