Category parameter

Adding category parameter for the messages.
In fact the code here is taken from amilloy@618745a , dunno why he did not perform the pull request