Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logging tweaks #275

Closed
wants to merge 1 commit into from
Closed

Logging tweaks #275

wants to merge 1 commit into from

Conversation

SimonWoolf
Copy link
Member

Fixes #273. See #273 (comment) for explanation and justification of changes. Basic idea is to keep LOG_MAJOR for high-level, user-friendly state information. If the user wants to peek into the inner workings of the lib (eg see connection upgrading, individual transports, potentially see raw protocol messages, etc), they need LOG_MINOR or higher.

Console log with LOG_MAJOR for connecting, channel attach, and one token renewal cycle, before changes:

Ably: ConnectionManager.chooseTransport(): Transport recovery mode = recover; connectionKey = undefined; connectionSerial = undefined 
Ably: ConnectionManager.chooseTransport(): upgrading ... connectionKey = 1082b!cdOMLOUkZzqbyBtS-4bad1082b 
Ably: Transport.onProtocolMessage(): error; connectionKey = 1082b!cdOMLOUkZzqbyBtS-4bae1082b; err = {"message":"Key/token status changed (expire)","code":40142,"statusCode":401} 
Ably: ConnectionManager.chooseTransport():  
Ably: ConnectionManager.chooseTransport(): Transport recovery mode = resume; connectionKey = 1082b!cdOMLOUkZzqbyBtS-4bae1082b; connectionSerial = -1 
Ably: ConnectionManager.chooseTransport(): upgrading ... connectionKey = 1082b!cdOMLOUkZzqbyBtS-4baf1082b

After changes:

Ably: Connection state: connecting 
Ably: Connection state: connected 
Ably: Channel state for channel "channel": attaching 
Ably: Channel state for channel "channel": attached 
Ably: Connection state: disconnected; reason: Key/token status changed (expire), code: 40142 
Ably: Connection state: connecting 
Ably: Connection state: connected

@paddybyers
Copy link
Member

lgtm

SimonWoolf added a commit that referenced this pull request May 18, 2016
@SimonWoolf
Copy link
Member Author

Merged as b39872e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants