code: public LogWithPatternAndLevel get(Level level) {
          int l = level.ordinal();
  
          LogWithPatternAndLevel got = levels.get(l);
          if (got != null) {
              return got;
          }
  
          // slow path: create a new LogWithPatternAndLevel
          LogWithPatternAndLevel newValue = new LogWithPatternAndLevel(message,
                  level, rateAndPeriod, stats, stopwatch, logger);
  
          boolean wasSet = levels.compareAndSet(l, null, newValue);
          if (!wasSet) {
              return Objects.requireNonNull(levels.get(l));
          } else {
              // ensure we'll reset the counter once every period
              registry.register(newValue, rateAndPeriod.periodLength);
              return newValue;
          }
      }
docs: @return a LogWithPatternAndLevel object for the supplied @param level .
  This can be cached and reused by callers in performance-sensitive
  cases to avoid performing two ConcurrentHashMap lookups.
  
  Note that the string is the sole key used, so the same string cannot be reused with differing period
  settings; any periods which differ from the first one used are ignored.
  
  @throws IllegalStateException if we exceed the limit on number of RateLimitedLogWithPattern objects
  in any one period; if this happens, it's probable that an already-interpolated string is
  accidentally being used as a log pattern.