0

The log module is described here

quote:

::log::lvColor level color

Defines for the specified level the color to return for it in a call to ::log::lv2color. Unique abbreviations of level names are allowed.

But where is this color set? Does this mean that only a variable I can ask for is set to 'color'?

This:

log::log notice "Some message"

will print to console "Some message" in white (which is my default font color in gnome-terminal).

That does not change after

log::lvColor notice blue

This seems to have no effect. The application I am using is ModelSim. In the ModelSim console I don't get any string. All logs will appear on gnome-terminal.

Am I missing something or will the only change be that

log::lv2color notice

returns "blue" now?

Is there maybe any better way to get console output via "puts" in different colors?

Community
  • 1
  • 1
Sadık
  • 4,249
  • 7
  • 53
  • 89
  • Have a look at the ``term`` package (e.g. http://tcllib.sourceforge.net/doc/ansi_send.html ) maybe thats what you need. – schlenk Jan 24 '14 at 19:09

1 Answers1

1

The package does not itself make use of the color settings, they're only provided as a tool for Tk application writers who wish to use this package for logging messages and, doing so, to colorize them, highlighting differences in levels.

There is no standardized way to colorize output by stdout / stderr, but I suspect there are console applications that provide that option.

Peter Lewerin
  • 13,140
  • 1
  • 24
  • 27
  • Tkcon does this, putting stdout in black, stderr in red and stdin in blue. (Well, it's all simulated in tkcon, but it's nice.) – Donal Fellows Jan 24 '14 at 19:45