Maintenance: Migrated not existing log level notice to info.

This commit is contained in:
Thorsten Eckel 2020-11-27 10:49:36 +01:00
parent dd192ed572
commit 5d62cb21da
4 changed files with 20 additions and 20 deletions

View file

@ -802,8 +802,8 @@ returns
case level
when 'debug'
Rails.logger.debug { message }
when 'notice'
Rails.logger.notice message
when 'info'
Rails.logger.info message
else
Rails.logger.error message
end

View file

@ -16,7 +16,7 @@ To execute this manually, just paste the following into the browser console
client_list = Sessions.list
client_list.each do |local_client_id, local_client|
if local_client_id == @client_id
log 'notice', 'do not send broadcast to it self'
log 'info', 'do not send broadcast to it self'
next
end
@ -33,14 +33,14 @@ To execute this manually, just paste the following into the browser console
next if local_client[:user]['id'].to_i != user_id.to_i
log 'notice', "send broadcast from (#{@client_id}) to (user_id=#{user_id})", local_client_id
log 'info', "send broadcast from (#{@client_id}) to (user_id=#{user_id})", local_client_id
websocket_send(local_client_id, @payload['data'])
end
end
# broadcast every client
else
log 'notice', "send broadcast from (#{@client_id})", local_client_id
log 'info', "send broadcast from (#{@client_id})", local_client_id
websocket_send(local_client_id, @payload['data'])
end
end

View file

@ -14,9 +14,9 @@ To execute this manually, just paste the following into the browser console
# error handling
if @payload['timestamp']
log 'notice', "request spool data > '#{Time.at(@payload['timestamp']).utc.iso8601}'"
log 'info', "request spool data > '#{Time.at(@payload['timestamp']).utc.iso8601}'"
else
log 'notice', 'request spool with init data'
log 'info', 'request spool with init data'
end
if !@session || !@session['id']
@ -34,15 +34,15 @@ To execute this manually, just paste the following into the browser console
# create new msg to push to client
if item[:type] == 'direct'
log 'notice', "send spool to (user_id=#{@session['id']})"
log 'info', "send spool to (user_id=#{@session['id']})"
else
log 'notice', 'send spool'
log 'info', 'send spool'
end
websocket_send(@client_id, item[:message])
end
# send spool:sent event to client
log 'notice', 'send spool:sent event'
log 'info', 'send spool:sent event'
{
event: 'spool:sent',
data: {

View file

@ -49,7 +49,7 @@ class WebsocketServer
def self.onopen(websocket, handshake)
headers = handshake.headers
client_id = websocket.object_id.to_s
log 'notice', 'Client connected.', client_id
log 'info', 'Client connected.', client_id
Sessions.create( client_id, {}, { type: 'websocket' } )
return if @clients.include? client_id
@ -64,7 +64,7 @@ class WebsocketServer
def self.onclose(websocket)
client_id = websocket.object_id.to_s
log 'notice', 'Client disconnected.', client_id
log 'info', 'Client disconnected.', client_id
# removed from current client list
if @clients.include? client_id
@ -129,7 +129,7 @@ class WebsocketServer
end
def self.check_unused_connections
log 'notice', 'check unused idle connections...'
log 'info', 'check unused idle connections...'
idle_time_in_sec = 4 * 60
@ -138,7 +138,7 @@ class WebsocketServer
next if ( client[:last_ping].to_i + idle_time_in_sec ) >= Time.now.utc.to_i
log 'notice', 'closing idle websocket connection', client_id
log 'info', 'closing idle websocket connection', client_id
# remember to not use this connection anymore
client[:disconnect] = true
@ -154,7 +154,7 @@ class WebsocketServer
# close unused ajax long polling sessions
clients = Sessions.destroy_idle_sessions(idle_time_in_sec)
clients.each do |client_id|
log 'notice', 'closing idle long polling connection', client_id
log 'info', 'closing idle long polling connection', client_id
end
end
@ -170,7 +170,7 @@ class WebsocketServer
queue = Sessions.queue(client_id)
next if queue.blank?
log 'notice', 'send data to client', client_id
log 'info', 'send data to client', client_id
websocket_send(client_id, queue)
rescue => e
log 'error', "problem:#{e.inspect}", client_id
@ -186,9 +186,9 @@ class WebsocketServer
def self.log_status
# websocket
log 'notice', "Status: websocket clients: #{@clients.size}"
log 'info', "Status: websocket clients: #{@clients.size}"
@clients.each_key do |client_id|
log 'notice', 'working...', client_id
log 'info', 'working...', client_id
end
# ajax
@ -199,11 +199,11 @@ class WebsocketServer
clients = clients + 1
end
log 'notice', "Status: ajax clients: #{clients}"
log 'info', "Status: ajax clients: #{clients}"
client_list.each do |client_id, client|
next if client[:meta][:type] == 'websocket'
log 'notice', 'working...', client_id
log 'info', 'working...', client_id
end
end