/*
 * Copyright 2012-2013 Erwin Müller <erwin.mueller@deventm.org>
 *
 * This file is part of sscontrol-hostname.
 *
 * sscontrol-hostname is free software: you can redistribute it and/or modify it
 * under the terms of the GNU Affero General Public License as published by the
 * Free Software Foundation, either version 3 of the License, or (at your
 * option) any later version.
 *
 * sscontrol-hostname 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 Affero General Public License
 * for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with sscontrol-hostname. If not, see <http://www.gnu.org/licenses/>.
 */
package com.anrisoftware.sscontrol.hostname.service;

import static org.apache.commons.lang3.Validate.notEmpty;

import com.anrisoftware.globalpom.log.AbstractLogger;
import com.anrisoftware.sscontrol.core.api.ProfileService;

/**
 * Logging messages for {@link HostnameServiceImpl}.
 * 
 * @author Erwin Mueller, erwin.mueller@deventm.org
 * @since 1.0
 */
class HostnameServiceImplLogger extends AbstractLogger {

	/**
	 * Create logger for {@link HostnameServiceImpl}.
	 */
	HostnameServiceImplLogger() {
		super(HostnameServiceImpl.class);
	}

	void profileSet(HostnameServiceImpl service, ProfileService profile) {
		if (log.isTraceEnabled()) {
			log.trace("Set profile {} for {}.", profile, service);
		} else {
			log.info("Set profile {} for hostname service.",
					profile.getProfileName());
		}
	}

	void hostnameSet(HostnameServiceImpl service, String name) {
		if (log.isTraceEnabled()) {
			log.trace("Hostname '{}' set for {}.", name, service);
		} else {
			log.info("Hostname '{}' set.", name);
		}
	}

	void checkHostname(HostnameServiceImpl service, String name) {
		notEmpty(name, "The hostname must not be empty or null for %s.",
				service);
	}
}

@@ -1213,16 +1213,415 @@
 gger %7B%0A%0A
+%09private static final String HOSTNAME_EMPTY_NULL = %22Hostname must not be empty or null for %25s.%22;%0A%09private static final String HOSTNAME_SET_INFO = %22Hostname '%7B%7D' set.%22;%0A%09private static final String HOSTNAME_SET = %22Hostname '%7B%7D' set for %7B%7D.%22;%0A%09private static final String SET_PROFILE_INFO = %22Set profile %7B%7D for hostname service.%22;%0A%09private static final String SET_PROFILE = %22Set profile %7B%7D for %7B%7D.%22;%0A%0A
 %09/**%0A%09 *
@@ -1820,37 +1820,37 @@
 ) %7B%0A%09%09if (log.is
-Trace
+Debug
 Enabled()) %7B%0A%09%09%09
@@ -1857,38 +1857,25 @@
 log.
-trace(%22Set profile %7B%7D for %7B%7D.%22
+debug(SET_PROFILE
 , pr
@@ -1918,53 +1918,26 @@
 nfo(
-%22Set profile %7B%7D for hostname service.%22,%0A%09%09%09%09%09
+SET_PROFILE_INFO, 
 prof
@@ -2045,13 +2045,13 @@
 g.is
-Trace
+Debug
 Enab
@@ -2070,41 +2070,26 @@
 log.
-trace(%22Hostname '%7B%7D' set for %7B%7D.%22
+debug(HOSTNAME_SET
 , na
@@ -2125,36 +2125,33 @@
 og.info(
-%22Hostname '%7B%7D' set.%22
+HOSTNAME_SET_INFO
 , name);
@@ -2244,62 +2244,29 @@
 me, 
-%22The hostname must not be empty or null for %25s.%22,%0A%09%09%09%09
+HOSTNAME_EMPTY_NULL, 
 serv

Fix logging for hostname