public void onMessage(String channel, String sender, 
                          String login,   String hostname,
                          String message, Date calendar) {


        /*sends data to Message, and onto Listener*/
        ArrayList<Object> args = new ArrayList<Object>();
        args.add(channel);
        args.add(sender);
        args.add(login);
        args.add(hostname);
        args.add(message);
        args.add(calendar);

        Message.eventStart(args);

        createFunctions();
        
        if( Main.logging ) {
	        try {
	    		logDirectory = new File("logs");
	    		if ( !logDirectory.isDirectory() ) {
	    			logDirectory.mkdir();
	    		}
	    		date = sdf.parse(sdf.format(new Date())).toString().replaceAll(" ", "").replaceAll("[0-9]+:[0-9]+:[0-9]+CDT", "");
	    		logFile = new FileWriter(logDirectory.getAbsolutePath() + "/" + date + ".log", true);
	    		logFile.write(channel + ":" + sender + ":" + message + "\n");
	    		logFile.close();
	    	} catch (ParseException e) {
				System.err.println("Can not parse log file.. trying to create.");
				try {
					logFile = new FileWriter(logDirectory.getAbsolutePath() + date + ".log", false);
				} catch (IOException e1) {
					System.err.println("Can not create file..");
					e1.printStackTrace();
				}
				e.printStackTrace();
	    	} catch (IOException ioex) {
	    		System.err.println("Can not open log file..");
	    		ioex.printStackTrace();
			}
        }

        /*runs debugging method if activated*/
        if (Main.debug) {
            debug("onMessage()", args);
        }

    }