Improved aliases log.

This commit is contained in:
Christian P. MOMON 2018-01-07 22:45:50 +01:00
parent f2a384643e
commit 74a264fa7e
2 changed files with 24 additions and 1 deletions

View File

@ -173,7 +173,7 @@ public class HebdobotCLI
logger.info("Aliases file loading… ({}).", aliasFile.getAbsolutePath());
UserAliases aliases = new UserAliases(aliasFile);
logger.info("Aliases file loaded (" + aliases.size() + " aliases).");
logger.info("Alias liste:\n" + aliases.toString());
logger.info("Alias list: " + aliases.toLineString());
Hebdobot bot = new Hebdobot(config.getIrcHost(), config.getIrcPort(), config.getIrcName(), config.getIrcChannel(),
configFile.getParentFile(), reviewDirectory, config.getReviewFileSuffix());

View File

@ -145,6 +145,29 @@ public class UserAliases extends HashMap<String, String>
return result;
}
/**
* To line string.
*
* @return the string
*/
public String toLineString()
{
String result;
StringList buffer = new StringList();
for (String nick : new StringList(this.keySet()).sort())
{
buffer.append(getRealName(nick));
buffer.append(", ");
}
buffer.removeLast();
result = buffer.toString();
//
return result;
}
/* (non-Javadoc)
* @see java.util.AbstractMap#toString()
*/