@snippet
def logger_usage(client, to_delete):
 LOG_NAME = ('logger_usage_%d' % _millis())
 logger = client.logger(LOG_NAME)
 to_delete.append(logger)
 logger.log_text('A simple entry')
 logger.log_struct({'message': 'My second entry', 'weather': 'partly cloudy'})
 from google.cloud.logging import DESCENDING
 for entry in logger.list_entries(order_by=DESCENDING):
  do_something_with(entry)
 def _logger_delete():
  logger.delete()
 _backoff_not_found(_logger_delete)
 to_delete.remove(logger)

@ snippet def logger_usage ( client , to_delete ) : LOG_NAME = ( 'logger_usage_%d' % _millis ( ) ) logger = client . logger ( LOG_NAME ) to_delete . append ( logger ) logger . log_text ( 'A simple entry' ) logger . log_struct ( { 'message' : 'My second entry' , 'weather' : 'partly cloudy' } ) from google . cloud . logging import DESCENDING for entry in logger . list_entries ( order_by = DESCENDING ) : do_something_with ( entry ) def _logger_delete ( ) : logger . delete ( ) _backoff_not_found ( _logger_delete ) to_delete . remove ( logger )
logger usage .