Skip to content

Commit

Permalink
Sets exception printing in debug mode
Browse files Browse the repository at this point in the history
  • Loading branch information
pkriens committed Jan 7, 2025
1 parent 2f4c1a4 commit 2e3ae6c
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ interface BaseOptions extends Options {

@Description("Set per logger log level. The syntax is <logger-prefix>=<level>, where level is off, trace, debug, info, warn, error" )
String[] log();

}

public static void main(String[] args) {
Expand Down Expand Up @@ -147,6 +148,9 @@ public void __alloy(BaseOptions options) throws Exception {
if (commands.containsKey(subcommand)) {
try {
log.debug("subcommand {} found in {}", subcommand, target);
if (target instanceof Env env) {
env.setExceptions(options.debug());
}
String info = l.execute(target, subcommand, arguments);
if (info != null) {
System.out.println(info);
Expand Down

0 comments on commit 2e3ae6c

Please sign in to comment.