# Path: google/cloud/logging_v2/_helpers.py
#     class LogSeverity(object):
#         DEFAULT = 0
#         DEBUG = 100
#         INFO = 200
#         NOTICE = 300
#         WARNING = 400
#         ERROR = 500
#         CRITICAL = 600
#         ALERT = 700
#         EMERGENCY = 800
# _NORMALIZED_SEVERITIES = {
#     logging.CRITICAL: LogSeverity.CRITICAL,
#     logging.ERROR: LogSeverity.ERROR,
#     logging.WARNING: LogSeverity.WARNING,
#     logging.INFO: LogSeverity.INFO,
#     logging.DEBUG: LogSeverity.DEBUG,
#     logging.NOTSET: LogSeverity.DEFAULT,
# }
# _TIME_FORMAT = "%Y-%m-%dT%H:%M:%S.%f%z"
# METADATA_URL = "http://metadata.google.internal./computeMetadata/v1/"
# METADATA_HEADERS = {"Metadata-Flavor": "Google"}
# def entry_from_resource(resource, client, loggers):
# def retrieve_metadata_server(metadata_key, timeout=5):
# def _normalize_severity(stdlib_level):
# def _add_defaults_to_filter(filter_):
# 
# Path: google/cloud/logging_v2/handlers/transports/base.py
# class Transport(object):
#     """Base class for Google Cloud Logging handler transports.
# 
#     Subclasses of :class:`Transport` must have constructors that accept a
#     client and name object, and must override :meth:`send`.
#     """
# 
#     def __init__(self, client, name, resource=_GLOBAL_RESOURCE, **kwargs):
#         """
#         Args:
#             client (~logging_v2.client.Client):
#                 The Logging client.
#             name (str): The name of the lgoger.
#             resource (Optional[Resource|dict]): The default monitored resource to associate
#                 with logs when not specified
#         """
#         super().__init__()
# 
#     def send(self, record, message, **kwargs):
#         """Transport send to be implemented by subclasses.
# 
#         Args:
#             record (logging.LogRecord): Python log record that the handler was called with.
#             message (str or dict): The message from the ``LogRecord`` after being
#                 formatted by the associated log formatters.
#             kwargs: Additional optional arguments for the logger
#         """
#         raise NotImplementedError
# 
#     def flush(self):
#         """Submit any pending log records.
# 
#         For blocking/sync transports, this is a no-op.
#         """
# 
# Path: google/cloud/logging_v2/logger.py
# _GLOBAL_RESOURCE = Resource(type="global", labels={})


from google.cloud.logging_v2 import _helpers
from google.cloud.logging_v2.handlers.transports.base import Transport
from google.cloud.logging_v2.logger import _GLOBAL_RESOURCE
    """

    def __init__(self, client, name, resource=_GLOBAL_RESOURCE, **kwargs):
        """
        Args:
            client (~logging_v2.client.Client):
                The Logging client.
            name (str): The name of the lgoger.
            resource (Optional[Resource|dict]): The default monitored resource to associate
                with logs when not specified
        """
        self.logger = client.logger(name, resource=resource)

    def send(self, record, message, **kwargs):
        """Overrides transport.send().

        Args:
            record (logging.LogRecord):
                Python log record that the handler was called with.
            message (str or dict): The message from the ``LogRecord`` after being
                formatted by the associated log formatters.
            kwargs: Additional optional arguments for the logger
        """
        # set python logger name as label if missing
        labels = kwargs.pop("labels", {})
        if record.name:
            labels["python_logger"] = labels.get("python_logger", record.name)
        # send log synchronously
        self.logger.log(
            message,

# Path: google/cloud/logging_v2/_helpers.py
#     class LogSeverity(object):
#         DEFAULT = 0
#         DEBUG = 100
#         INFO = 200
#         NOTICE = 300
#         WARNING = 400
#         ERROR = 500
#         CRITICAL = 600
#         ALERT = 700
#         EMERGENCY = 800
# _NORMALIZED_SEVERITIES = {
#     logging.CRITICAL: LogSeverity.CRITICAL,
#     logging.ERROR: LogSeverity.ERROR,
#     logging.WARNING: LogSeverity.WARNING,
#     logging.INFO: LogSeverity.INFO,
#     logging.DEBUG: LogSeverity.DEBUG,
#     logging.NOTSET: LogSeverity.DEFAULT,
# }
# _TIME_FORMAT = "%Y-%m-%dT%H:%M:%S.%f%z"
# METADATA_URL = "http://metadata.google.internal./computeMetadata/v1/"
# METADATA_HEADERS = {"Metadata-Flavor": "Google"}
# def entry_from_resource(resource, client, loggers):
# def retrieve_metadata_server(metadata_key, timeout=5):
# def _normalize_severity(stdlib_level):
# def _add_defaults_to_filter(filter_):
# 
# Path: google/cloud/logging_v2/handlers/transports/base.py
# class Transport(object):
#     """Base class for Google Cloud Logging handler transports.
# 
#     Subclasses of :class:`Transport` must have constructors that accept a
#     client and name object, and must override :meth:`send`.
#     """
# 
#     def __init__(self, client, name, resource=_GLOBAL_RESOURCE, **kwargs):
#         """
#         Args:
#             client (~logging_v2.client.Client):
#                 The Logging client.
#             name (str): The name of the lgoger.
#             resource (Optional[Resource|dict]): The default monitored resource to associate
#                 with logs when not specified
#         """
#         super().__init__()
# 
#     def send(self, record, message, **kwargs):
#         """Transport send to be implemented by subclasses.
# 
#         Args:
#             record (logging.LogRecord): Python log record that the handler was called with.
#             message (str or dict): The message from the ``LogRecord`` after being
#                 formatted by the associated log formatters.
#             kwargs: Additional optional arguments for the logger
#         """
#         raise NotImplementedError
# 
#     def flush(self):
#         """Submit any pending log records.
# 
#         For blocking/sync transports, this is a no-op.
#         """
# 
# Path: google/cloud/logging_v2/logger.py
# _GLOBAL_RESOURCE = Resource(type="global", labels={})


# Path: google/cloud/logging_v2/handlers/transports/sync.py
from google.cloud.logging_v2 import _helpers
from google.cloud.logging_v2.handlers.transports.base import Transport
from google.cloud.logging_v2.logger import _GLOBAL_RESOURCE

    """

    def __init__(self, client, name, resource=_GLOBAL_RESOURCE, **kwargs):
        """
        Args:
            client (~logging_v2.client.Client):
                The Logging client.
            name (str): The name of the lgoger.
            resource (Optional[Resource|dict]): The default monitored resource to associate
                with logs when not specified
        """
        self.logger = client.logger(name, resource=resource)

    def send(self, record, message, **kwargs):
        """Overrides transport.send().

        Args:
            record (logging.LogRecord):
                Python log record that the handler was called with.
            message (str or dict): The message from the ``LogRecord`` after being
                formatted by the associated log formatters.
            kwargs: Additional optional arguments for the logger
        """
        # set python logger name as label if missing
        labels = kwargs.pop("labels", {})
        if record.name:
            labels["python_logger"] = labels.get("python_logger", record.name)
        # send log synchronously
        self.logger.log(
            message,

            severity=_helpers._normalize_severity(record.levelno),