Github user chtyim commented on a diff in the pull request: https://github.com/apache/twill/pull/14#discussion_r83117233 --- Diff: twill-yarn/src/main/java/org/apache/twill/internal/appmaster/ApplicationMasterService.java --- @@ -951,4 +958,34 @@ public void run() { } }; } + + /** + * Attempt to change the log level from a runnable or all runnables. + * + * @return {@code true} if the message requests changing log levels and {@code false} otherwise. + */ + private boolean handleLogLevelChange(final Message message, final Runnable completion) { + Message.Scope scope = message.getScope(); + if (message.getType() != Message.Type.SYSTEM || + (scope != Message.Scope.RUNNABLE && scope != Message.Scope.ALL_RUNNABLE)) { + return false; + } + + Command command = message.getCommand(); + if (!command.getCommand().equals(SystemMessages.LOG_LEVEL)) { + return false; + } + + if (scope == Message.Scope.ALL_RUNNABLE) { + runningContainers.sendToAll(message, completion); + } else { + final String runnableName = message.getRunnableName(); + if (runnableName == null || runnableName.isEmpty() || !twillSpec.getRunnables().containsKey(runnableName)) { --- End diff -- No need to check if `runnableName` is empty.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---