[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.newcomer] Re: How to make System.out.println(...) in color in Eclipse?
|
- From: luke2000@xxxxxx (Ludwig Moser)
- Date: Mon, 16 Mar 2009 09:04:51 +0000 (UTC)
- Newsgroups: eclipse.newcomer
- Organization: Eclipse
- User-agent: NewsPortal/0.36 (http://florian-amrhein.de/newsportal)
afaik you can't
but you can add pre's
eg:
public class ImportanceLogger {
public ImportanceLogger() {
}
public static void Log(int importance, String message) {
String pre = "";
if (importance > 0) {
for (int i = 0; i < importance; i++) {
pre += "-";
}
} else {
System.out.println(message);
return;
}
System.out.println(pre + ">\t" + message);
return;
}
public static void main(String[] args) {
for (int i = 0; i < 7; i++) {
Log(i, "importance = "+i);
}
}
}
which would output:
importance = 0
-> importance = 1
--> importance = 2
---> importance = 3
----> importance = 4
-----> importance = 5
------> importance = 6
greets