code: private static boolean writeIfNotEmpty(OutputAccessor out, boolean hasFields, String field, Object value) {
  
          if (value == null) {
              return hasFields;
          }
  
          if (value instanceof String) {
  
              if (GelfMessage.isEmpty((String) value)) {
                  return hasFields;
              }
  
              if (hasFields) {
                  writeKeyValueSeparator(out);
              }
  
              writeMapEntry(out, field, value);
  
              return true;
          }
  
          if (hasFields) {
              writeKeyValueSeparator(out);
          }
  
          writeMapEntry(out, field, value);
  
          return true;
      }
docs: Write a Value to JSON if the value is not empty.