Navigation Menu

Skip to content

Commit

Permalink
Don't output logs from NodeMetadata module.
Browse files Browse the repository at this point in the history
Logs from the module breaks JSON structure of the response from serf-event-handler.
  • Loading branch information
piroor committed Apr 8, 2015
1 parent ca30d16 commit 8b61c62
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions lib/droonga/node_metadata.rb
Expand Up @@ -15,14 +15,11 @@

require "json"

require "droonga/loggable"
require "droonga/path"
require "droonga/safe_file_writer"

module Droonga
class NodeMetadata
include Loggable

module Role
SERVICE_PROVIDER = "service-provider"
ABSORB_SOURCE = "absorb-source"
Expand Down Expand Up @@ -55,14 +52,12 @@ def get(key)
end

def set(key, value)
logger.debug("setting: #{key}=#{value}")
key = normalize_key(key)
@metadata[key] = value
SafeFileWriter.write(metadata_file, JSON.pretty_generate(@metadata))
end

def delete(key)
logger.debug("deleting: #{key}")
key = normalize_key(key)
@metadata.delete(key)
SafeFileWriter.write(metadata_file, JSON.pretty_generate(@metadata))
Expand Down Expand Up @@ -112,16 +107,11 @@ def metadata_file
def load
if metadata_file.exist?
contents = metadata_file.read
logger.debug("metadata loaded from file", :metadata => contents)
unless contents.empty?
return JSON.parse(contents, :symbolize_names => true)
end
end
{}
end

def log_tag
"node_metadata"
end
end
end

0 comments on commit 8b61c62

Please sign in to comment.