From c25b77fb6bf513e47f9a800aab5c401404fe554a Mon Sep 17 00:00:00 2001 From: Kartikey Tanna Date: Sun, 3 May 2020 11:52:06 +0530 Subject: [PATCH] Added docs for client-side logger --- actioncable/app/javascript/action_cable/logger.js | 5 +++++ guides/source/action_cable_overview.md | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/actioncable/app/javascript/action_cable/logger.js b/actioncable/app/javascript/action_cable/logger.js index ef4661ead1..f4b99390c1 100644 --- a/actioncable/app/javascript/action_cable/logger.js +++ b/actioncable/app/javascript/action_cable/logger.js @@ -1,5 +1,10 @@ import adapters from "./adapters" +// The logger can be enabled with: +// +// ActionCable.logger.enabled = true +// + export default { log(...messages) { if (this.enabled) { diff --git a/guides/source/action_cable_overview.md b/guides/source/action_cable_overview.md index 3dc75bcfa6..f456948c75 100644 --- a/guides/source/action_cable_overview.md +++ b/guides/source/action_cable_overview.md @@ -771,6 +771,14 @@ config.action_cable.log_tags = [ For a full list of all configuration options, see the `ActionCable::Server::Configuration` class. +Client-side logs can be enabled with the following: + +```ruby +import * as ActionCable from '@rails/actioncable' + +ActionCable.logger.enabled = true +``` + ## Running Standalone Cable Servers ### In App