[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?

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