4

Echo tasks have a logging level associated with them, and I've been able to use this to turn off certain debug messages by default, like echoing the CLASSPATH before every build.

That's great, except now I don't know how to get the debug messages to show up at all, via a command-line argument. Everything I've read refers to this, so it must be possible to set the log level, but I've no idea how to set it. Thanks!

I'm sure this is a simple thing I must have missed in the documentation, but a quite a few likely search queries returned no relevant results. A method to do this via Eclipse or IntelliJ would probably also be relevant.

Ant has several command line options for controlling its own verbosity (-quiet, -verbose), but these do not appear to correspond to log levels for <echo> tasks, and certainly cannot map to all possible log levels.

I see also that you can set the log level from within the build file, but that's not what I need.

Community
  • 1
  • 1
jpaugh
  • 6,634
  • 4
  • 38
  • 90
  • [Echo tasks](https://ant.apache.org/manual/Tasks/echo.html) do have a logging level associated with them. – jpaugh Sep 29 '15 at 21:49
  • I can get the echo messages not to show up by changing the level to `debug`, but I'd also like to know how to override this default. Thanks! – jpaugh Sep 29 '15 at 21:50
  • 1
    Well, I stand corrected then ;P -- One way to achieve what you want would be to make a variable in your script which accepts a cmd line passed in parameter, say `ant -Dloglevel=debug` and in the script `${loglevel}` is used in place of hard-coding the echo level, ie: `` -- or at the top of your script you setup the variable as a default which can be changed if desired: `` – SnakeDoc Sep 29 '15 at 21:54
  • 1
    That's a good option, and possibly saner than what I have come to understand about the commands. I'll post a (partial) answer shortly, if you're interested. – jpaugh Sep 29 '15 at 21:58

1 Answers1

2

According to this email, the following mappings are set up:

Cmd arg  | Log level
---------+----------
<none>   | INFO
-verbose | VERBOSE
-debug   | DEBUG
-quiet   | ???
-silent  | ???
???      | ???

If you can find any more, please edit this post and add them to the list! In particular, I wonder what -quiet does to the logging level.

Also see Running Apache Ant page for details on arguments:
https://ant.apache.org/manual/running.html

Dan Dar3
  • 1,199
  • 13
  • 23
jpaugh
  • 6,634
  • 4
  • 38
  • 90