<commit_before>/*
 * Copyright 2013 <NAME> <<EMAIL>>
 *
 * This file is part of globalpom-utils.
 *
 * globalpom-utils is free software: you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published by the
 * Free Software Foundation, either version 3 of the License, or (at your
 * option) any later version.
 *
 * globalpom-utils is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with globalpom-utils. If not, see <http://www.gnu.org/licenses/>.
 */
package com.anrisoftware.globalpom.format.inetsocketaddress;

import java.net.URI;
import java.net.URISyntaxException;
import java.text.ParseException;
import java.text.ParsePosition;

import com.anrisoftware.globalpom.log.AbstractLogger;

/**
 * Logging messages for {@link InetSocketAddressFormat}.
 * 
 * @author <NAME>, <EMAIL>
 * @since 1.0
 */
class InetSocketAddressFormatLogger extends AbstractLogger {

	/**
	 * Create logger for {@link InetSocketAddressFormat}.
	 */
	InetSocketAddressFormatLogger() {
		super(InetSocketAddressFormat.class);
	}

	ParseException errorParseAddress(String source, ParsePosition pos) {
		ParseException ex = new ParseException(String.format(
				"Unparseable socket address: '%s'", source),
				pos.getErrorIndex());
		log.error(ex.getLocalizedMessage());
		return ex;
	}

	URISyntaxException errorURISyntax(URI uri) {
		URISyntaxException ex = new URISyntaxException(uri.toString(),
				"URI must have a host part");
		log.error(ex.getLocalizedMessage());
		return ex;
	}

	URISyntaxException errorURISyntax(String hostName, URISyntaxException e) {
		log.error("Syntax error for URI {}: {}", hostName,
				e.getLocalizedMessage());
		return e;
	}

}<commit_msg>Update logging<commit_after>/*
 * Copyright 2013 <NAME> <<EMAIL>>
 *
 * This file is part of globalpom-utils.
 *
 * globalpom-utils is free software: you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published by the
 * Free Software Foundation, either version 3 of the License, or (at your
 * option) any later version.
 *
 * globalpom-utils is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with globalpom-utils. If not, see <http://www.gnu.org/licenses/>.
 */
package com.anrisoftware.globalpom.format.inetsocketaddress;

import static java.lang.String.format;

import java.net.URI;
import java.net.URISyntaxException;
import java.text.ParseException;
import java.text.ParsePosition;

import com.anrisoftware.globalpom.log.AbstractLogger;

/**
 * Logging messages for {@link InetSocketAddressFormat}.
 * 
 * @author <NAME>, <EMAIL>
 * @since 1.0
 */
class InetSocketAddressFormatLogger extends AbstractLogger {

	private static final String SYNTAX_ERROR = "Syntax error for URI {}: {}";
	private static final String URI_HOST_PART_MESSAGE = "URI '{}' must have a host part.";
	private static final String URI_HOST_PART = "URI must have a host part";
	private static final String UNPARSEABLE_SOCKET_ADDRESS_MESSAGE = "Unparseable socket address: '{}'";
	private static final String UNPARSEABLE_SOCKET_ADDRESS = "Unparseable socket address: '%s'";

	/**
	 * Create logger for {@link InetSocketAddressFormat}.
	 */
	InetSocketAddressFormatLogger() {
		super(InetSocketAddressFormat.class);
	}

	ParseException errorParseAddress(String source, ParsePosition pos) {
		return logException(
				new ParseException(format(UNPARSEABLE_SOCKET_ADDRESS, source),
						pos.getErrorIndex()),
				UNPARSEABLE_SOCKET_ADDRESS_MESSAGE, source);
	}

	URISyntaxException errorURISyntax(URI uri) {
		return logException(new URISyntaxException(uri.toString(),
				URI_HOST_PART), URI_HOST_PART_MESSAGE, uri);
	}

	URISyntaxException errorURISyntax(String hostName, URISyntaxException e) {
		log.error(SYNTAX_ERROR, hostName, e.getLocalizedMessage());
		return e;
	}

}
{'fraction_non_alphanumeric': 0.0937140225650472, 'fraction_numerical': 0.0032235781717706653, 'mean_word_length': 4.723320158102767, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, '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': '6208114', 'n_tokens_mistral': 1333, 'n_tokens_neox': 1258, 'n_words': 415}