All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.anrisoftware.fractions.calculator.parser.FindFractionServiceLogger Maven / Gradle / Ivy

/*
 * Copyright 2013-2015 Erwin Müller 
 *
 * This file is part of fractions-calculator-cli.
 *
 * fractions-calculator-cli is free software: you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the Free
 * Software Foundation, either version 3 of the License, or (at your option) any
 * later version.
 *
 * fractions-calculator-cli 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 General Public License along with
 * fractions-calculator-cli. If not, see .
 */
package com.anrisoftware.fractions.calculator.parser;

import static com.anrisoftware.fractions.calculator.parser.FindFractionServiceLogger._.error_find_service;
import static com.anrisoftware.fractions.calculator.parser.FindFractionServiceLogger._.error_find_service_message;
import static com.anrisoftware.fractions.calculator.parser.FindFractionServiceLogger._.service;

import javax.inject.Singleton;

import com.anrisoftware.globalpom.log.AbstractLogger;

/**
 * Logging messages for {@link FindFractionService}.
 * 
 * @author Erwin Mueller, [email protected]
 * @since 2.0
 */
@Singleton
class FindFractionServiceLogger extends AbstractLogger {

	enum _ {

		error_find_service("Error find service"),

		error_find_service_message("Error find service '{}'."),

		service("service");

		private String name;

		private _(String name) {
			this.name = name;
		}

		@Override
		public String toString() {
			return name;
		}
	}

	/**
	 * Creates a logger for {@link FindFractionService}.
	 */
	public FindFractionServiceLogger() {
		super(FindFractionService.class);
	}

	ArgsException errorFindService(Object info) {
		return logException(
				new ArgsException(error_find_service).add(service, info),
				error_find_service_message, info);
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy