Skip to content
This repository was archived by the owner on Oct 19, 2018. It is now read-only.

Commit f800e6f

Browse files
committed
Disable warning / info log in production config
1 parent 1b963e2 commit f800e6f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lib/reactive-ruby/isomorphic_helpers.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
require "react/config"
2+
13
module React
24
module IsomorphicHelpers
35
def self.included(base)
@@ -28,6 +30,13 @@ def self.load_context(unique_id = nil, name = nil)
2830

2931
def self.log(message, message_type = :info)
3032
message = [message] unless message.is_a? Array
33+
34+
is_production = React::Config.config[:environment] == 'production'
35+
36+
if (message_type == :info || message_type == :warning) && is_production
37+
return
38+
end
39+
3140
if message_type == :info
3241
if on_opal_server?
3342
style = 'background: #00FFFF; color: red'

0 commit comments

Comments
 (0)