public void run() {
        try {
            connect();
        } catch (IOException e) {
            try {
                reconnect();
            } catch (InterruptedException | IOException e1) {
                showLevelMessage(ERROR, "Cannot connect to: " + getServer());
            }
        }
        while (getOnline()) try {

            String logCurrentLine;
            while ((logCurrentLine = reader.readLine()) != null) {

                Matcher logLine = logPattern.matcher(logCurrentLine);

                if (getDebug()) showLevelMessage(DEBUG, logCurrentLine);

                if(logLine.find())
                    servMessage(
                            logLine.group(0), //raw
                            logLine.group(1), //prefix
                            logLine.group(2), //type
                            logLine.group(3), //destination
                            logLine.group(4)  //message
                    );

                writer.flush();

            }
        } catch (IOException | InterruptedException | ParseException ignored) {
        }
    }