Skip to content

Commit

Permalink
[core] remove noisy logs (#2715)
Browse files Browse the repository at this point in the history
They don't give us any useful information.
  • Loading branch information
degemer committed Jul 28, 2016
1 parent af96b9e commit 489902e
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 16 deletions.
1 change: 0 additions & 1 deletion agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,6 @@ def main():
return Agent.info(verbose=options.verbose)

elif 'foreground' == command:
logging.info('Running in foreground')
if autorestart:
# Set-up the supervisor callbacks and fork it.
logging.info('Running Agent with auto-restart ON')
Expand Down
10 changes: 1 addition & 9 deletions daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

log = logging.getLogger(__name__)


class AgentSupervisor(object):
''' A simple supervisor to keep a restart a child on expected auto-restarts
'''
Expand Down Expand Up @@ -152,7 +153,6 @@ def daemonize(self):

log.info("Daemon started")


def start(self, foreground=False):
log.info("Starting")
pid = self.pid()
Expand All @@ -168,13 +168,11 @@ def start(self, foreground=False):
log.warn("pidfile doesn't contain the pid of an agent process."
' Starting normally')

log.info("Pidfile: %s" % self.pidfile)
if not foreground:
self.daemonize()
self.write_pidfile()
self.run()


def stop(self):
log.info("Stopping daemon")
pid = self.pid()
Expand Down Expand Up @@ -211,13 +209,11 @@ def stop(self):

return # Not an error in a restart


def restart(self):
"Restart the daemon"
self.stop()
self.start()


def run(self):
"""
You should override this method when you subclass Daemon. It will be called after the process has been
Expand All @@ -233,7 +229,6 @@ def info(cls):
"""
raise NotImplementedError


def status(self):
"""
Get the status of the daemon. Exits with 0 if running, 1 if not.
Expand Down Expand Up @@ -268,7 +263,6 @@ def status(self):
sys.stdout.write(message + "\n")
sys.exit(exit_code)


def pid(self):
# Get the pid from the pidfile
try:
Expand All @@ -281,7 +275,6 @@ def pid(self):
except ValueError:
return None


def write_pidfile(self):
# Write pidfile
atexit.register(self.delpid) # Make sure pid file is removed if we quit
Expand All @@ -297,7 +290,6 @@ def write_pidfile(self):
sys.stderr.write(msg + "\n")
sys.exit(1)


def delpid(self):
try:
os.remove(self.pidfile)
Expand Down
2 changes: 0 additions & 2 deletions dogstatsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,8 +473,6 @@ def init(config_path=None, use_watchdog=False, use_forwarder=False, args=None):
sleep(4)
sys.exit(0)

log.debug("Configuring dogstatsd")

port = c['dogstatsd_port']
interval = DOGSTATSD_FLUSH_INTERVAL
api_key = c['api_key']
Expand Down
6 changes: 2 additions & 4 deletions utils/proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def get_proxy(agentConfig):
proxy_settings['user'] = agentConfig.get('proxy_user')
proxy_settings['password'] = agentConfig.get('proxy_password')
log.debug("Proxy Settings: %s:*****@%s:%s", proxy_settings['user'],
proxy_settings['host'], proxy_settings['port'])
proxy_settings['host'], proxy_settings['port'])
return proxy_settings

# If no proxy configuration was specified in datadog.conf
Expand All @@ -62,13 +62,11 @@ def get_proxy(agentConfig):
proxy_settings['password'] = parse.password

log.debug("Proxy Settings: %s:*****@%s:%s", proxy_settings['user'],
proxy_settings['host'], proxy_settings['port'])
proxy_settings['host'], proxy_settings['port'])
return proxy_settings

except Exception as e:
log.debug("Error while trying to fetch proxy settings using urllib %s."
"Proxy is probably not set", str(e))

log.debug("No proxy configured")

return None

0 comments on commit 489902e

Please sign in to comment.