improve formatting

This commit is contained in:
jm
2015-08-03 10:02:32 +02:00
committed by Ondřej Košarko
parent aed0741fec
commit 565d391eb8
3 changed files with 10 additions and 8 deletions

View File

@@ -41,19 +41,19 @@ public class InfoCheck extends Check {
for (String[] ss : new String[][] {
new String[] {
ConfigurationManager.getProperty("assetstore.dir"),
"Assetstore size: ", },
"Assetstore size", },
new String[] {
ConfigurationManager.getProperty("search.dir"),
"Search dir size: ", },
"Search dir size", },
new String[] {
ConfigurationManager.getProperty("log.dir"),
"Log dir size: ", }, })
"Log dir size", }, })
{
try {
File dir = new File(ss[0]);
if (dir.exists()) {
long dir_size = FileUtils.sizeOfDirectory(dir);
sb.append(String.format("%s: %s\n", ss[1],
sb.append(String.format("%-20s: %s\n", ss[1],
FileUtils.byteCountToDisplaySize(dir_size))
);
} else {

View File

@@ -54,7 +54,7 @@ public class LogAnalyserCheck extends Check {
// create report
for (String[] info : interesting_fields ) {
sb.append( String.format("%-17s: %s\n", info[1], info_map.get(info[0])) );
sb.append( String.format("%-20s: %s\n", info[1], info_map.get(info[0])) );
}
sb.append( String.format("Items added since [%s] (db): %s\n",
new SimpleDateFormat("yyyy-MM-dd").format(ri.from().getTime()),

View File

@@ -62,16 +62,18 @@ public class UserCheck extends Check {
}
ret += String.format(
"Users: %d\n", info.get("Count"));
"%-20s: %d\n", "Users", info.get("Count"));
ret += String.format(
"Have email: %d\n", info.get("Have email"));
"%-20s: %d\n", "Have email", info.get("Have email"));
for (Map.Entry<String, Integer> e : info.entrySet()) {
if (!e.getKey().equals("Count") && !e.getKey().equals("Have email")) {
ret += String.format("%s: %s\n", e.getKey(),
ret += String.format("%-20s: %s\n", e.getKey(),
String.valueOf(e.getValue()));
}
}
ret += "\n";
try {
// empty group
List<String> egs = Core.getEmptyGroups();