'host, port: statsD server'

def __init__(self, cfg):

    Logger.__init__(self, cfg)
    self.prefix = sub('^(.+[^.]+)\\.*$', '\\g<1>.', cfg.statsd_prefix)
    try:
        (host, port) = cfg.statsd_host
        self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
        self.sock.connect((host, int(port)))
    except Exception:
        self.sock = None
