enable_features Subroutine

public subroutine enable_features(fm, w)

Enable features requested in watch options.

Unknown feature names are ignored with a warning.

Arguments

Type IntentOptional Attributes Name
type(feature_manager_t), intent(inout) :: fm
type(watch_opts_t), intent(in) :: w

Calls

proc~~enable_features~~CallsGraph proc~enable_features enable_features proc~add_stats add_stats proc~enable_features->proc~add_stats proc~log_warn log_warn proc~enable_features->proc~log_warn proc~fm_add feature_manager_t%fm_add proc~add_stats->proc~fm_add proc~new_stats_feature new_stats_feature proc~add_stats->proc~new_stats_feature colorize colorize proc~log_warn->colorize

Called by

proc~~enable_features~~CalledByGraph proc~enable_features enable_features proc~watcher_init watcher_t%watcher_init proc~watcher_init->proc~enable_features

Source Code

   subroutine enable_features(fm, w)
      type(feature_manager_t), intent(inout) :: fm
      type(watch_opts_t), intent(in) :: w
      integer :: i
      character(len=:), allocatable :: name

      if (.not. allocated(w%enabled_features)) return

      do i = 1, size(w%enabled_features)
         name = trim(w%enabled_features(i)%s)
         if (len_trim(name) == 0) cycle

         select case (name)
          case ("stats")
            call add_stats(fm)
          case default
            call log_warn(w, "unknown feature '" // name // "' (ignored)")
         end select
      end do
   end subroutine enable_features