Logs the user agent info
161067
private static function log($data) {
        if (!$data) {
            $data = new \stdClass();
            $data->ua = self::$ua;
        } 
        $jsonData = json_encode($data);
        echo $jsonData."\r\n";
        //$fp = fopen(__DIR__."/log/user_agents.log", "a");
        //fwrite($fp, $jsonData."\r\n");
        //fclose($fp);
    }
409407
public void doLog(String clientID, String name, long time, Level level,
			Object message, Throwable t) {
		if (logOpen && formatter != null) {
			sendMessage(syslogMessage.createMessageData(formatter.format(clientID, name, time, level, message, t)));
		}
	}
815647
def safe_log_info(self, *info: str):
        """"""
        self.__do_safe(lambda: self.logger.info(*info))
219497
def data_filler_user_agent(self, number_of_rows, pipe):
        '''
        '''

        try:
            for i in range(number_of_rows):
                pipe.hmset('user_agent:%s' % i, {
                    'id': rnd_id_generator(self),
                    'ip': self.faker.ipv4(),
                    'countrycode': self.faker.country_code(),
                    'useragent': self.faker.user_agent()
                })
            pipe.execute()
            logger.warning('user_agent Commits are successful after write job!', extra=d)

        except Exception as e:
            logger.error(e, extra=d)
676754
def _log(self, fname, txt, prg=''):
        
        if os.sep not in fname:
            fname = self.log_folder + os.sep + fname
        delim = ','
        q = '"'
        dte = TodayAsString()
        usr = GetUserName()
        hst = GetHostName()
        i = self.session_id
 
        if prg == '':
            prg = 'cls_log.log' 
        logEntry = q + dte + q + delim + q + i + q + delim + q + usr + q + delim + q + hst + q + delim + q + prg + q + delim + q + txt + q + delim + '\n'
        with open(fname, "a", encoding='utf-8', errors='replace') as myfile:
            myfile.write(logEntry)
36098
def log_action( action, resource=nil )
    err_msg = ( resource.nil? ? '' : resource.errors.full_messages.uniq.join(", ") )
    logger.debug(
      "MILIA >>>>> [register user/org] #{action} - #{err_msg}"
    ) unless logger.nil?
  end
1313084
def cli_info(self, event):
        """"""

        self.log('Instance:', self.instance,
                 'Dev:', self.development,
                 'Host:', self.host,
                 'Port:', self.port,
                 'Insecure:', self.insecure,
                 'Frontend:', self.frontendtarget)
916260
def request_log_level(agent_name, command, options)
      res = false
      config_options = AgentConfig.agent_options(agent_name)
      unless config_options.empty? || (listen_port = config_options[:listen_port]).nil?
        fail("Could not retrieve #{agent_name} agent listen port") unless listen_port
        client = CommandClient.new(listen_port, config_options[:cookie])
        begin
          client.send_command(command, options[:verbose], timeout = 5) do |level|
            puts "Agent #{agent_name} log level: #{level.to_s.upcase}"
          end
          res = true
        rescue Exception => e
          puts "Command #{command.inspect} to #{agent_name} agent failed (#{e})"
        end
      end
      res
    end
891097
def info (logname, msg, *args, **kwargs):
    
    log = logging.getLogger(logname)
    if log.isEnabledFor(logging.INFO):
        _log(log.info, msg, args, **kwargs)
783473
function(loggingEvent) {
		var useragent = "unknown";
		try {
			useragent = navigator.userAgent;
		} catch(e){
			useragent = "unknown";
		}
		
		var referer = "unknown";
		try {
			referer = location.href;
		} catch(e){
			referer = "unknown";
		}
				
		var content = "<log4js:event logger=\"";
		content += loggingEvent.categoryName + "\" level=\"";
		content += loggingEvent.level.toString() + "\" useragent=\"";
		content += useragent + "\" referer=\"";
		content += referer.replace(/&/g, "&amp;") + "\" timestamp=\"";
		content += loggingEvent.getFormattedTimestamp() + "\">\n";
		content += "\t<log4js:message><![CDATA[" + this.escapeCdata(loggingEvent.message) + "]]></log4js:message>\n";	
 		
 		if (loggingEvent.exception) {
			content += this.formatException(loggingEvent.exception) ;
		}
 		content += "</log4js:event>\n";
        
      return content;
	}
397069
def request_agent_stats(agent_name, options)
      res = false
      config_options = AgentConfig.agent_options(agent_name)
      unless config_options.empty? || (listen_port = config_options[:listen_port]).nil?
        client = CommandClient.new(listen_port, config_options[:cookie])
        command = {:name => :stats, :reset => options[:reset]}
        begin
          client.send_command(command, verbose = false, options[:timeout]) { |r| display(agent_name, r, options) }
          res = true
        rescue Exception => e
          msg = "Could not retrieve #{agent_name} agent stats: #{e}"
          msg += "\n" + e.backtrace.join("\n") unless e.message =~ /Timed out/
          fail(msg)
        end
      end
      res
    end
1239305
function Agent(session, agentInfo) {
  this.info         = utils.roCopy(agentInfo)
  this._session     = session
  this._isDestroyed = false
  this._receiveCBs  = new SMap()
}
59772
def userlogin(self, event):
        """"""

        try:
            user_uuid = event.useruuid
            user = objectmodels['user'].find_one({'uuid': user_uuid})

            if user_uuid not in self.lastlogs:
                self.log('Setting up lastlog for a new user.', lvl=debug)
                lastlog = objectmodels['chatlastlog']({
                    'owner': user_uuid,
                    'uuid': std_uuid(),
                    'channels': {}
                })
                lastlog.save()
                self.lastlogs[user_uuid] = lastlog

            self.users[user_uuid] = user
            self.user_attention[user_uuid] = None
            self._send_status(user_uuid, event.clientuuid)
        except Exception as e:
            self.log('Error during chat setup of user:', e, type(e), exc=True)
1020069
def info(self, msg, indent=0, **kwargs):
        """"""
        return self.logger.info(self._indent(msg, indent), **kwargs)
220933
def _log(self, s):
    """
    # TODO(tewalds): Should this be using logging.info instead? How to see them
    # outside of google infrastructure?
    sys.stderr.write(s)
    sys.stderr.flush()
101016
function sessionCreated(err, session) {
  var agentInfo = {name: ping + "er", title: "a " + ping + "er" }

  session.createAgent(agentInfo, function(err, agent) {
    console.log(ping + " agent created")
    Agent = agent
  })

  session.on("ragentCreated", function(ragent) {
    ragentCreated(ragent, "created")
  })

  session.getRemoteAgents(function(err, ragents){
    ragents.forEach(function(ragent) {
      ragentCreated(ragent, "existed")
    })
  })
}
1189282
def logSysInfo():
    """"""
    logger.info('#' * 70)
    logger.info(datetime.today().strftime("%A, %d %B %Y %I:%M%p"))
    logger.info('Running on [{0}] [{1}]'.format(platform.node(),
                                                platform.platform()))
    logger.info('Python [{0}]'.format(sys.version))
    logger.info('#' * 70 + '\n')