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[][] { for (String[] ss : new String[][] {
new String[] { new String[] {
ConfigurationManager.getProperty("assetstore.dir"), ConfigurationManager.getProperty("assetstore.dir"),
"Assetstore size: ", }, "Assetstore size", },
new String[] { new String[] {
ConfigurationManager.getProperty("search.dir"), ConfigurationManager.getProperty("search.dir"),
"Search dir size: ", }, "Search dir size", },
new String[] { new String[] {
ConfigurationManager.getProperty("log.dir"), ConfigurationManager.getProperty("log.dir"),
"Log dir size: ", }, }) "Log dir size", }, })
{ {
try { try {
File dir = new File(ss[0]); File dir = new File(ss[0]);
if (dir.exists()) { if (dir.exists()) {
long dir_size = FileUtils.sizeOfDirectory(dir); 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)) FileUtils.byteCountToDisplaySize(dir_size))
); );
} else { } else {

View File

@@ -54,7 +54,7 @@ public class LogAnalyserCheck extends Check {
// create report // create report
for (String[] info : interesting_fields ) { 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", sb.append( String.format("Items added since [%s] (db): %s\n",
new SimpleDateFormat("yyyy-MM-dd").format(ri.from().getTime()), new SimpleDateFormat("yyyy-MM-dd").format(ri.from().getTime()),

View File

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