public void message(String msg, int priority) {
        //if the priority is less than Threshold it is handled
        if (priority <= Threshold) {
            writeMessage(msg);
        }

        if (next != null) {
            next.message(msg, priority);
        }
    }