Sha256: 5f3fdec6cc2285e7b0554120e13fd93fc9588a3a5823738b801d88695eea0540

Contents?: true

Size: 933 Bytes

Versions: 41

Compression:

Stored size: 933 Bytes

Contents

# Logging

This page provides logging tips to help you debug your applications.

## Accessing the Logger

Logging is enabled by default in this library using Ruby's standard Logger class.

You can access the library logger with the logger property of Google::Apis.

## Log Level
You can set the logging level to one of the following:

- FATAL (least amount of logging)
- ERROR
- WARN
- INFO
- DEBUG (most amount of logging)
In the following code, the logging level is set to DEBUG and the Google Plus API is called:

```rb
require 'google/apis/plus_v1'

Google::Apis.logger.level = Logger::DEBUG

plus = Google::Apis::PlusV1::PlusService.new
activities = plus.list_activities('103354693083460731603', 'public')
```

The output of this code should include debug info:

```
D, [2015-06-26T14:33:42.583914 #12144] DEBUG -- : Sending HTTP get https://www.googleapis.com/plus/v1/people/103354693083460731603/activities/public?key=...
```

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
google-api-client-0.52.0 docs/logging.md
google-api-client-0.51.0 docs/logging.md
google-api-client-0.50.0 docs/logging.md
google-api-client-0.49.0 docs/logging.md
google-api-client-0.48.0 docs/logging.md
google-api-client-0.47.0 docs/logging.md
google-api-client-0.46.2 docs/logging.md
google-api-client-0.46.1 docs/logging.md
google-api-client-0.46.0 docs/logging.md
google-api-client-0.45.1 docs/logging.md
google-api-client-0.45.0 docs/logging.md
google-api-client-0.44.2 docs/logging.md
google-api-client-0.44.1 docs/logging.md
google-api-client-0.44.0 docs/logging.md
google-api-client-0.43.0 docs/logging.md
google-api-client-0.42.2 docs/logging.md
google-api-client-0.42.1 docs/logging.md
google-api-client-0.42.0 docs/logging.md
google-api-client-0.41.2 docs/logging.md
google-api-client-0.41.1 docs/logging.md