mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
22 lines
478 B
JavaScript
22 lines
478 B
JavaScript
import adapters from "./adapters"
|
|
|
|
// The logger is disabled by default. You can enable it with:
|
|
//
|
|
// ActionCable.logger.enabled = true
|
|
//
|
|
// Example:
|
|
//
|
|
// import * as ActionCable from '@rails/actioncable'
|
|
//
|
|
// ActionCable.logger.enabled = true
|
|
// ActionCable.logger.log('Connection Established.')
|
|
//
|
|
|
|
export default {
|
|
log(...messages) {
|
|
if (this.enabled) {
|
|
messages.push(Date.now())
|
|
adapters.logger.log("[ActionCable]", ...messages)
|
|
}
|
|
},
|
|
}
|