1414 "httpRequest" ,
1515 "rpcName" ,
1616 "serviceName" ,
17+ "credentialsType" ,
18+ "credentialInfo" ,
19+ "universeDomain" ,
20+ "request" ,
21+ "response" ,
22+ "metadata" ,
23+ "retryAttempt" ,
1724] # Additional fields to be Logged.
1825
1926
20- # TODO(https://github.com/googleapis/python-api-core/issues/763): Expand documentation.
21- def logger_configured (logger ):
27+ def logger_configured (logger ) -> bool :
2228 """Determines whether `logger` has non-default configuration
2329
2430 Args:
@@ -32,7 +38,6 @@ def logger_configured(logger):
3238 )
3339
3440
35- # TODO(https://github.com/googleapis/python-api-core/issues/763): Expand documentation.
3641def initialize_logging ():
3742 """Initializes "google" loggers, partly based on the environment variable
3843
@@ -55,7 +60,6 @@ def initialize_logging():
5560 _LOGGING_INITIALIZED = True
5661
5762
58- # TODO(https://github.com/googleapis/python-api-core/issues/763): Expand documentation.
5963def parse_logging_scopes (scopes : Optional [str ] = None ) -> List [str ]:
6064 """Returns a list of logger names.
6165
@@ -76,7 +80,6 @@ def parse_logging_scopes(scopes: Optional[str] = None) -> List[str]:
7680 return namespaces
7781
7882
79- # TODO(https://github.com/googleapis/python-api-core/issues/763): Expand documentation.
8083def configure_defaults (logger ):
8184 """Configures `logger` to emit structured info to stdout."""
8285 if not logger_configured (logger ):
@@ -88,8 +91,7 @@ def configure_defaults(logger):
8891 logger .addHandler (console_handler )
8992
9093
91- # TODO(https://github.com/googleapis/python-api-core/issues/763): Expand documentation.
92- def setup_logging (scopes = "" ):
94+ def setup_logging (scopes : str = "" ):
9395 """Sets up logging for the specified `scopes`.
9496
9597 If the loggers specified in `scopes` have not been previously
@@ -122,11 +124,11 @@ def setup_logging(scopes=""):
122124 base_logger .propagate = False
123125
124126
125- # TODO(https://github.com/googleapis/python-api-core/issues/763): Add documentation.
127+ # TODO(https://github.com/googleapis/python-api-core/issues/763): Expand documentation.
126128class StructuredLogFormatter (logging .Formatter ):
127129 # TODO(https://github.com/googleapis/python-api-core/issues/761): ensure that additional fields such as
128130 # function name, file name, and line no. appear in a log output.
129- def format (self , record ):
131+ def format (self , record : logging . LogRecord ):
130132 log_obj = {
131133 "timestamp" : self .formatTime (record ),
132134 "severity" : record .levelname ,
0 commit comments