public String [ ] get_logging_target ( String dev_name ) throws DevFailed { //- Get device by name DeviceImpl dev = Util . instance ( ) . get_device_by_name ( dev_name ) ; //- Get device targets (i.e appenders) Enumeration all_appenders = dev . get_logger ( ) . getAllAppenders ( ) ; //- Instanciate returned value int num_appenders = 0 ; Enumeration a_shame_copy = dev . get_logger ( ) . getAllAppenders ( ) ; while ( a_shame_copy . hasMoreElements ( ) ) { num_appenders ++ ; a_shame_copy . nextElement ( ) ; } String [ ] targets = new String [ num_appenders ] ; //- Populate the returned value num_appenders = 0 ; while ( all_appenders . hasMoreElements ( ) ) { Appender appender = ( Appender ) all_appenders . nextElement ( ) ; targets [ num_appenders ++ ] = appender . getName ( ) ; } return targets ; }
Get logging target for the specified devices