Closed rweng closed 9 years ago
Second field is usually reserved for color overrides. The problem you're having is the color function is trying to detect the second param as a valid color property, but since it isn't, its' rejected. The workaround would be to fallback to a string
input if validation fails.
$log.log('%c Oh my heavens! ', 'background: #222; color: #bada55');
arg. I thought since you have examples like $log = $log.getInstance(...)
, that the API would actually stay the same as in normal angular $log
, which you do use like $log.log(p1, p2, p3, ...)
.
Too bad, this is actually a show-stopper for us, since we are not going to use a custom API. I would expect the styling to be overwritten as it is used on the provider, with $log.setLogMethodColor
.
I get what your saying, but it's not really a limitation of the library per say, but the browsers. If you take a look at the documentation for coloring in chrome/ff the second parameter always defines color
console.log("%cThis will be formatted with large, blue text", "color: blue; font-size: x-large");
https://developer.chrome.com/devtools/docs/console#styling-console-output-with-css.
If if you use $log.warn
or console.log
, you still would need to do the same thing. We can iterate over the items in the argument list apply the coloring function and grouping the respective params, but they must be strings..
Hi,
color support works fine when using
however, with multiple parameters it doesn't work:
All the best, Robin