Override to apply styling on access logs.

        This duplicates a large portion of `gunicorn.glogging.Logger.access`,
        only adding
516278
def access(self, resp, req, environ, request_time):
        
        if not (self.cfg.accesslog or self.cfg.logconfig or self.cfg.syslog):
            return

        msg = self.make_access_message(resp, req, environ, request_time)
        try:
            self.access_log.info(msg)
        except:
            self.error(traceback.format_exc())
1103476
def decorate(self, record):
        
        color = 'gray'
        if record.levelno == logging.WARNING:
            color = 'yellow'
        if record.levelno == logging.INFO:
            color = 'green'
        if record.levelno == logging.DEBUG:
            color = 'gray'
        if record.levelno >= logging.ERROR:
            color = 'red'

        notify = False
        if record.levelno >= logging.ERROR:
            nofiy = True

        payload = {
            'color': color,
            'notify': notify,
            'message_format': 'text'
        }

        return payload
42642
def apply_style(*style_names)
      if style_names
        selected.each do |selected_view|
          style_names.each do |style_name|
            apply_style_to_view selected_view, style_name
          end
        end
      end
      self
    end
1104497
def apply_augmentations(linter):
    """"""
    augment_visit(linter, TypeChecker.visit_attribute, foreign_key_sets)
    augment_visit(linter, TypeChecker.visit_attribute, foreign_key_ids)
    suppress_message(linter, TypeChecker.visit_attribute, 'no-member', is_model_field_display_method)
    suppress_message(linter, TypeChecker.visit_attribute, 'no-member', is_style_attribute)
    suppress_message(linter, NameChecker.visit_assignname, 'invalid-name', is_urls_module_valid_constant)

    # supress errors when accessing magical class attributes
    suppress_message(linter, TypeChecker.visit_attribute, 'no-member', is_manager_attribute)
    suppress_message(linter, TypeChecker.visit_attribute, 'no-member', is_admin_attribute)
    suppress_message(linter, TypeChecker.visit_attribute, 'no-member', is_model_attribute)
    suppress_message(linter, TypeChecker.visit_attribute, 'no-member', is_field_attribute)
    suppress_message(linter, TypeChecker.visit_attribute, 'no-member', is_charfield_attribute)
    suppress_message(linter, TypeChecker.visit_attribute, 'no-member', is_datefield_attribute)
    suppress_message(linter, TypeChecker.visit_attribute, 'no-member', is_decimalfield_attribute)
    suppress_message(linter, TypeChecker.visit_attribute, 'no-member', is_filefield_attribute)
    suppress_message(linter, TypeChecker.visit_attribute, 'no-member', is_imagefield_attribute)
    suppress_message(linter, TypeChecker.visit_attribute, 'no-member', is_ipfield_attribute)
    suppress_message(linter, TypeChecker.visit_attribute, 'no-member', is_slugfield_attribute)
    suppress_message(linter, TypeChecker.visit_attribute, 'no-member', is_foreignkeyfield_attribute)
    suppress_message(linter, TypeChecker.visit_attribute, 'no-member', is_manytomanyfield_attribute)
    suppress_message(linter, TypeChecker.visit_attribute, 'no-member', is_onetoonefield_attribute)
    suppress_message(linter, TypeChecker.visit_attribute, 'no-member', is_form_attribute)

    for parents, attrs in VIEW_ATTRS:
        suppress_message(linter, TypeChecker.visit_attribute, 'no-member', generic_is_view_attribute(parents, attrs))

    # formviews have too many ancestors, there's nothing the user of the library can do about that
    suppress_message(linter, MisdesignChecker.visit_classdef, 'too-many-ancestors',
                     is_class('django.views.generic.edit.FormView'))

    # model forms have no __init__ method anywhere in their bases
    suppress_message(linter, ClassChecker.visit_classdef, 'W0232', is_class('django.forms.models.ModelForm'))

    # Meta
    suppress_message(linter, DocStringChecker.visit_classdef, 'missing-docstring', is_model_meta_subclass)
    pylint_newstyle_classdef_compat(linter, 'old-style-class', is_model_meta_subclass)
    suppress_message(linter, ClassChecker.visit_classdef, 'no-init', is_model_meta_subclass)
    suppress_message(linter, MisdesignChecker.leave_classdef, 'too-few-public-methods', is_model_meta_subclass)
    suppress_message(linter, ClassChecker.visit_attribute, 'protected-access', allow_meta_protected_access)

    # Media
    suppress_message(linter, NameChecker.visit_assignname, 'C0103', is_model_media_valid_attributes)
    suppress_message(linter, DocStringChecker.visit_classdef, 'missing-docstring', is_model_media_subclass)
    pylint_newstyle_classdef_compat(linter, 'old-style-class', is_model_media_subclass)
    suppress_message(linter, ClassChecker.visit_classdef, 'no-init', is_model_media_subclass)
    suppress_message(linter, MisdesignChecker.leave_classdef, 'too-few-public-methods', is_model_media_subclass)

    # Admin
    # Too many public methods (40+/20)
    # TODO: Count public methods of django.contrib.admin.options.ModelAdmin and increase
    # MisdesignChecker.config.max_public_methods to this value to count only user' methods.
    # nb_public_methods = 0
    # for method in node.methods():
    #     if not method.name.startswith('_'):
    #         nb_public_methods += 1
    suppress_message(linter, MisdesignChecker.leave_classdef, 'R0904', is_model_admin_subclass)

    # Tests
    suppress_message(linter, MisdesignChecker.leave_classdef, 'R0904', is_model_test_case_subclass)

    # View
    # Method could be a function (get, post)
    suppress_message(linter, ClassChecker.leave_functiondef, 'no-self-use',
                     is_model_view_subclass_method_shouldnt_be_function)
    # Unused argument 'request' (get, post)
    suppress_message(linter, VariablesChecker.leave_functiondef, 'unused-argument',
                     is_model_view_subclass_unused_argument)
    suppress_message(linter, VariablesChecker.leave_functiondef, 'unused-argument', is_argument_named_request)

    # django-mptt
    suppress_message(linter, DocStringChecker.visit_classdef, 'missing-docstring', is_model_mpttmeta_subclass)
    pylint_newstyle_classdef_compat(linter, 'old-style-class', is_model_mpttmeta_subclass)
    suppress_message(linter, ClassChecker.visit_classdef, 'W0232', is_model_mpttmeta_subclass)
    suppress_message(linter, MisdesignChecker.leave_classdef, 'too-few-public-methods', is_model_mpttmeta_subclass)

    # factory_boy's DjangoModelFactory
    suppress_message(linter, TypeChecker.visit_attribute, 'no-member', is_model_factory)
    suppress_message(linter, ClassChecker.visit_functiondef, 'no-self-argument', is_factory_post_generation_method)

    # ForeignKey and OneToOneField
    # Must update this in a thread safe way to support the parallel option on pylint (-j)
    current_leave_module = VariablesChecker.leave_module
    if current_leave_module.__name__ == 'leave_module':
        # current_leave_module is not wrapped
        # Two threads may hit the next assignment concurrently, but the result is the same
        VariablesChecker.leave_module = wrap(current_leave_module, ignore_import_warnings_for_related_fields)
        # VariablesChecker.leave_module is now wrapped
    # else VariablesChecker.leave_module is already wrapped

    # wsgi.py
    suppress_message(linter, NameChecker.visit_assignname, 'invalid-name', is_wsgi_application)
213060
private void maybeAddGoogScopeUsage(NodeTraversal t, Node n, Node parent) {
    checkState(NodeUtil.isNameDeclaration(n));
    if (n.hasOneChild() && parent == googScopeBlock) {
      Node rhs = n.getFirstFirstChild();
      if (rhs != null && rhs.isQualifiedName()) {
        Node root = NodeUtil.getRootOfQualifiedName(rhs);
        if (root.isName()) {
          Var var = t.getScope().getVar(root.getString());
          if (var == null || (var.isGlobal() && !var.isExtern())) {
            usages.put(rhs.getQualifiedName(), rhs);
          }
        }
      }
    }
  }
949822
private void addAppendNodelets() {
        parser.setXpath("/aspectran/append");
        parser.addNodelet(attrs -> {
            String file = attrs.get("file");
            String resource = attrs.get("resource");
            String url = attrs.get("url");
            String format = attrs.get("format");
            String profile = attrs.get("profile");

            RuleAppendHandler appendHandler = assistant.getRuleAppendHandler();
            if (appendHandler != null) {
                AppendRule appendRule = AppendRule.newInstance(file, resource, url, format, profile);
                appendHandler.pending(appendRule);
            }
        });
    }
987982
def LogAccessWrapper(func):
  """"""

  def Wrapper(request, *args, **kwargs):
    """Wrapping function."""
    try:
      response = func(request, *args, **kwargs)
      server_logging.LOGGER.LogHttpAdminUIAccess(request, response)
    except Exception:  # pylint: disable=g-broad-except
      # This should never happen: wrapped function is supposed to handle
      # all possible exceptions and generate a proper Response object.
      # Still, handling exceptions here to guarantee that the access is logged
      # no matter what.
      response = werkzeug_wrappers.Response("", status=500)
      server_logging.LOGGER.LogHttpAdminUIAccess(request, response)
      raise

    return response

  return Wrapper
101976
def log_prefix(self, prefix, *messages):
        """"""
        if self.verbose:
            self.display(messages, prefix, debug=True)
498286
private void updateStyle(JTable c) {
        SeaGlassContext context  = getContext(c, ENABLED);
        SynthStyle      oldStyle = style;

        SynthStyle s = SeaGlassLookAndFeel.updateStyle(context, this);
        if (s instanceof SeaGlassStyle) {
            style = (SeaGlassStyle) s;

            selectionActiveBottomBorderColor   = UIManager.getColor("seaGlassTableSelectionActiveBottom");
            selectionInactiveBottomBorderColor = UIManager.getColor("seaGlassTableSelectionInactiveBottom");
            transparentColor                   = UIManager.getColor("seaGlassTransparent");

            if (style != oldStyle) {
                table.remove(rendererPane);
                rendererPane = createCustomCellRendererPane();
                table.add(rendererPane);

                context.setComponentState(ENABLED | SELECTED);

                Color sbg = table.getSelectionBackground();

                if (sbg == null || sbg instanceof UIResource) {
                    table.setSelectionBackground(style.getColor(context, ColorType.TEXT_BACKGROUND));
                }

                Color sfg = table.getSelectionForeground();

                if (sfg == null || sfg instanceof UIResource) {
                    table.setSelectionForeground(style.getColor(context, ColorType.TEXT_FOREGROUND));
                }

                context.setComponentState(ENABLED);

                Color gridColor = table.getGridColor();

                if (gridColor == null || gridColor instanceof UIResource) {
                    gridColor = (Color) style.get(context, "Table.gridColor");
                    if (gridColor == null) {
                        gridColor = style.getColor(context, ColorType.FOREGROUND);
                    }

                    table.setGridColor(gridColor);
                }

                useTableColors = style.getBoolean(context, "Table.rendererUseTableColors", true);
                useUIBorder    = style.getBoolean(context, "Table.rendererUseUIBorder", true);

                Object rowHeight = style.get(context, "Table.rowHeight");

                if (rowHeight != null) {
                    LookAndFeel.installProperty(table, "rowHeight", rowHeight);
                }

                boolean showGrid = style.getBoolean(context, "Table.showGrid", true);

                if (!showGrid) {
                    table.setShowGrid(false);
                }

                Dimension d = table.getIntercellSpacing();
                // if (d == null || d instanceof UIResource) {
                if (d != null) {
                    d = (Dimension) style.get(context, "Table.intercellSpacing");
                }

                alternateColor = (Color) style.get(context, "Table.alternateRowColor");
                if (d != null) {
                    table.setIntercellSpacing(d);
                }

                table.setOpaque(false);

                if (alternateColor != null) {
                    table.setShowHorizontalLines(false);
                }

                // Make header column extend the width of the viewport (if there is
                // a viewport).
                table.getTableHeader().setBorder(createTableHeaderEmptyColumnPainter(table));
                setViewPortListeners(table);

                if (oldStyle != null) {
                    uninstallKeyboardActions();
                    installKeyboardActions();
                }
            }
        }
        
        context.dispose();
    }
553834
private void addDescriptionNodelets() {
        parser.setXpath("/aspectran/description");
        parser.addNodelet(attrs -> {
            String style = attrs.get("style");
            parser.pushObject(style);
        });
        parser.addNodeEndlet(text -> {
            String style = parser.popObject();
            if (style != null) {
                text = TextStyler.styling(text, style);
            }
            if (StringUtils.hasText(text)) {
                assistant.getAssistantLocal().setDescription(text);
            }
        });
    }
1340285
def access_log(request, response)
      return if access_log_dest.nil?

      @@access_logger ||= init_access_log
      code = response.respond_to?(:code) ? response.code.to_s : "success"
      size = response.respond_to?(:size) ? response.size : response.length
      output = [request.ip_address, request.selector, request.input, code.to_s, size].join("\t")

      @@access_logger.debug output
    end
569577
def modify_log_flags(self, settings):
        
        if not isinstance(settings, basestring):
            raise TypeError("settings can only be an instance of type basestring")
        self._call("modifyLogFlags",
                     in_p=[settings])
440661
def hide_stevedore_logs():
    
    stevedore_logger = logging.getLogger('stevedore.extension')
    stevedore_logger.propagate = False
    stevedore_logger.setLevel(logging.ERROR)
    stevedore_logger.addHandler(logging.NullHandler())
1026181
def _add_handler(cls, handler, fmt, level):
        
        handler.setFormatter(_get_formatter(fmt))
        if level:
            handler.setLevel(level)
        logging.root.addHandler(handler)
        cls.used_formats = ("%s %s" % (cls.used_formats or "", fmt)).strip()
        cls.handlers.append(handler)
272407
def add_aggregator(agg)
      agg = RequestLogAnalyzer::Aggregator.const_get(RequestLogAnalyzer.to_camelcase(agg)) if agg.is_a?(String) || agg.is_a?(Symbol)
      @aggregators << agg.new(@source, @options)
    end
38238
def add_log_type(name, display, color, bcolor):
    
    global MESSAGE_LOG
    v_name = name.replace(" ", "_").upper()
    val = 0
    lkey = MESSAGE_LOG.keys()
    while val in lkey:
        val += 1

    MESSAGE_LOG[val] = [v_name, (display, color, bcolor,)]
    setattr(LOG, v_name, val)
570944
def default_log_template(self, record):
    

    reset = Style.RESET_ALL
    levelname = [
        LEVEL_COLORS.get(record.levelname),
        Style.BRIGHT,
        '(%(levelname)s)',
        Style.RESET_ALL,
        ' ',
    ]
    asctime = [
        '[',
        Fore.BLACK,
        Style.DIM,
        Style.BRIGHT,
        '%(asctime)s',
        Fore.RESET,
        Style.RESET_ALL,
        ']',
    ]
    name = [
        ' ',
        Fore.WHITE,
        Style.DIM,
        Style.BRIGHT,
        '%(name)s',
        Fore.RESET,
        Style.RESET_ALL,
        ' ',
    ]

    tpl = "".join(reset + levelname + asctime + name + reset)

    return tpl