@@ -154,38 +154,35 @@ private fun handleCommands(singleArgs: SingleArgs, multipleArgs: MultipleArgs, s
154154 }
155155
156156 if (status.status)
157- println (" Supervisor online, PID ${status.pid} " )
157+ LOGGER .info (" Supervisor online, PID ${status.pid} " )
158158 else
159- println (" Supervisor OFFLINE -- please check your configuration" )
159+ LOGGER .info (" Supervisor OFFLINE -- please check your configuration" )
160160 }
161161 " list_applications" -> if (singleArgs[" list_applications" ] as Boolean ) {
162162 val applications = supervisor.listApplications()
163- println (" Currently ${applications.size} application(s)\n -------" )
164- for (app in applications) {
165- println (" ${app.commandString} \n -PID: ${app.pid} \n -Alive?: ${app.isRunning} " )
166- }
163+ LOGGER .info(" Currently ${applications.size} application(s)" )
164+ for (app in applications)
165+ LOGGER .info(" ${app.commandString} \n -PID: ${app.pid} \n -Alive?: ${app.isRunning} " )
167166 }
168167 }
169168
170169 for (arg in multipleArgs)
171170 when (arg.key) {
172171 " add_application" -> for (app in arg.value) {
173172 val asString = app as String
174- if (asString == " " )
175- continue
173+ if (asString.isEmpty()) continue
176174
177175 val commandString = asString.split(" " ).toTypedArray()
178176 val appPid = supervisor.addApplication(commandString)
179- println (" Started application [$asString ] -- PID $appPid " )
177+ LOGGER .info (" Started application [$asString ] -- PID $appPid " )
180178 }
181179 " remove_application" -> for (app in arg.value) {
182180 val asLong = app as Long
183- if (asLong == - 1L )
184- continue
181+ if (asLong == - 1L ) continue
185182
186183 try {
187184 supervisor.removeApplication(asLong)
188- println (" Removed application with PID $asLong " )
185+ LOGGER .info (" Removed application with PID $asLong " )
189186 } catch (anfe: ApplicationNotFoundException ) {
190187 LOGGER .warning(" There is no application with PID $asLong " )
191188 LOGGER .log(Level .FINE , anfe) { " Exception info:" }
0 commit comments