<commit_before>var Server  = require("./udp_server").Server;
var channels = require("./channels");

var SERVER_PORT = 12345;

var server = new Server("127.0.0.1", SERVER_PORT);

server.on("message", function(message, client) {
  var channel = channels.byName(message.channelName);
  if(message.isPublication()) {
    channel.publish(message);
    console.log("Publication on "+channel.name+"\n: "+message.content);
  } else if(message.isSubscription()) {
    channel.addSubscriber(client);
    console.log("Subscription on "+channel.name);
  }
});<commit_msg>Add invalid message logging<commit_after>var Server  = require("./udp_server").Server;
var channels = require("./channels");

var SERVER_PORT = 12345;

var server = new Server("127.0.0.1", SERVER_PORT);

server.on("message", function(message, client) {
  var channel = channels.byName(message.channelName);
  if(message.isPublication()) {
    channel.publish(message);
    console.log("Publication on "+channel.name+"\n: "+message.content);
  } else if(message.isSubscription()) {
    channel.addSubscriber(client);
    console.log("Subscription on "+channel.name);
  } else {
    console.log("Invalid message: '" + message.raw +"'");
  }
});
{'fraction_non_alphanumeric': 0.17152373022481265, 'fraction_numerical': 0.018318068276436304, 'mean_word_length': 4.921182266009852, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2704274', 'n_tokens_mistral': 387, 'n_tokens_neox': 377, 'n_words': 71}