Create a katcp logging inform message.

        Usually this will be called from inside a DeviceLogger object,
        but it is also used by the methods in this class when errors
        need to be reported to the client.
14421
def create_log_inform(self, level_name, msg, name, timestamp=None):
        
        if timestamp is None:
            timestamp = time.time()

        katcp_version = self.PROTOCOL_INFO.major
        timestamp_msg = ('%.6f' % timestamp
                         if katcp_version >= SEC_TS_KATCP_MAJOR
                         else str(int(timestamp*1000)))
        return Message.inform("log", level_name, timestamp_msg, name, msg)
376348
def _create_stdout_logger():
    
    log = logging.getLogger(__name__)
    out_hdlr = logging.StreamHandler(sys.stdout)
    out_hdlr.setFormatter(logging.Formatter('%(message)s'))
    out_hdlr.setLevel(logging.INFO)
    log.addHandler(out_hdlr)
    log.setLevel(logging.INFO)
978064
public void info(Object message, Throwable t)
    {
        if (IS12)
        {
            getLogger().log(FQCN, Level.INFO, message, t);
        }
        else
        {
            getLogger().log(FQCN, Level.INFO, message, t);
        }
    }
231019
def info(self, message):
        
        if Settings.InfoLogs:
            self._write_log("info", Settings.LogTime, message)
825504
public static void printInfo(Object caller, Object message)
	{
		
		StringBuilder text = new StringBuilder();

		Class<?> c = callerBuilder(caller, text);

		if(message instanceof Throwable)
			getLog(c).info(text.append(stackTrace((Throwable)message)));
		else
			getLog(c).info(text.append(message));

	}
1358306
private void createKeysIfNotExist() {
        if (!keyPairExists()) {
            try {
                final KeyPair keyPair = generateKeyPair();
                save(keyPair);
            } catch (NoSuchAlgorithmException e) {
                LOGGER.error("An error occurred generating new keypair");
                LOGGER.error(e.getMessage());
            } catch (IOException e) {
                LOGGER.error("An error occurred saving newly generated keypair");
                LOGGER.error(e.getMessage());
            }
        }
        if (!secretKeyExists()) {
            try {
                final SecretKey secretKey = generateSecretKey();
                save(secretKey);
            } catch (NoSuchAlgorithmException e) {
                LOGGER.error("An error occurred generating new secret key");
                LOGGER.error(e.getMessage());
            } catch (IOException e) {
                LOGGER.error("An error occurred saving newly generated secret key");
                LOGGER.error(e.getMessage());
            }
        }
    }
343293
def info(message = nil, &block)
      logger.add(Logger::INFO, message, self.logging_prefix, &block)
    end
335686
function saveDeviceInfo(deviceInfo) {
            debugDC('in saveDeviceInfo');
            var key = getDeviceKey(deviceInfo);
            var connectionTypes = [];
            var newConnectionTypes = getDeviceConnectionTypesData(deviceInfo);

            if(scannedData[key]) {
                // The data has already been added.
                connectionTypes = scannedData[key].connectionTypes;
            } else {
                // The data has not been added.  Object needs to be initialized.
                scannedData[key] = {};
            }

            // Append new connection types to the connectionTypes array.
            debugDC('Initial CTS', connectionTypes.length, newConnectionTypes.length);
            connectionTypes = appendDeviceConnectionTypesData(
                connectionTypes,
                newConnectionTypes,
                deviceInfo
            );
            debugDC('Appended CTS', connectionTypes.length);

            // Parse the connectionTypes array to populate a few remaining
            // variables.
            scannedData[key].numConnectionTypes = connectionTypes.length;
            scannedData[key].connectionTypeNames = connectionTypes.map(function(ct) {
                return ct.connectionTypeName;
            });

            // Determine what connections are and aren't verified.
            scannedData[key].unverifiedConnectionTypes = [];
            scannedData[key].unverifiedConnectionTypeNames = [];
            scannedData[key].verifiedConnectionTypeNames = [];
            connectionTypes.forEach(function(ct) {
                var ctn = ct.connectionTypeName;
                if(ct.isVerified) {
                    scannedData[key].verifiedConnectionTypeNames.push(ctn);
                } else {
                    scannedData[key].unverifiedConnectionTypes.push(ct);
                    scannedData[key].unverifiedConnectionTypeNames.push(ctn);
                }
            });

            // Save the connectionTypes array.
            scannedData[key].connectionTypes = connectionTypes;

            // Save the deviceInfo object to the scannedData object.
            var iKeys = Object.keys(deviceInfo);
            iKeys.forEach(function(iKey) {
                if(typeof(scannedData[key][iKey]) === 'undefined') {
                    scannedData[key][iKey] = deviceInfo[iKey];
                }
            });
        }
23248
def create_log(self):
        """"""
        return EventLog(
            self.networkapi_url,
            self.user,
            self.password,
            self.user_ldap)
1268258
def log(self, message, result_code, log_message=""):
        
        return self.create(
            message_data=message.message_data,
            message_id=get_message_id(message.email),
            when_added=message.when_added,
            priority=message.priority,
            # @@@ other fields from Message
            result=result_code,
            log_message=log_message,
        )
352831
public void addDeviceAppender(final String deviceTargetName, final Class<?> deviceClassName,
            final String loggingDeviceName) throws DevFailed {
        if (rootLoggerBack != null) {
            logger.debug("add device appender {} on {}", deviceTargetName, loggingDeviceName);
            final DeviceAppender appender = new DeviceAppender(deviceTargetName, loggingDeviceName);
            deviceAppenders.put(loggingDeviceName.toLowerCase(Locale.ENGLISH), appender);
            rootLoggerBack.addAppender(appender);
            // debug level by default
            setLoggingLevel(LoggingLevel.DEBUG.toInt(), deviceClassName);
            setLoggingLevel(loggingDeviceName, LoggingLevel.DEBUG.toInt());
            appender.start();
        }
    }
1103139
public void info(Object message, Throwable t)
    {
        getLogger().info(message.toString(), t);
    }
373633
def info(message = nil, ex = nil, data = nil, &block)
      log(INFO, message, ex, data, block)
    end
1276138
private void createMonitor(LinkListener l) throws KNXException
	{
		final KNXMediumSettings medium = (KNXMediumSettings) options.get("medium");
		if (options.containsKey("serial")) {
			final String p = (String) options.get("serial");
			try {
				m = new KNXNetworkMonitorFT12(Integer.parseInt(p), medium);
			}
			catch (final NumberFormatException e) {
				m = new KNXNetworkMonitorFT12(p, medium);
			}
		}
		else {
			// create local and remote socket address for monitor link
			final InetSocketAddress local = createLocalSocket((InetAddress) options
				.get("localhost"), (Integer) options.get("localport"));
			final InetSocketAddress host = new InetSocketAddress((InetAddress) options
				.get("host"), ((Integer) options.get("port")).intValue());
			// create the monitor link, based on the KNXnet/IP protocol
			// specify whether network address translation shall be used,
			// and tell the physical medium of the KNX network
			m = new KNXNetworkMonitorIP(local, host, options.containsKey("nat"), medium);
		}
		// add the log writer for monitor log events
		LogManager.getManager().addWriter(m.getName(), w);
		// on console we want to have all possible information, so enable
		// decoding of a received raw frame by the monitor link
		m.setDecodeRawFrames(true);
		// listen to monitor link events
		m.addMonitorListener(l);
		// we always need a link closed notification (even with user supplied listener)
		m.addMonitorListener(new LinkListener() {
			public void indication(FrameEvent e)
			{}

			public void linkClosed(CloseEvent e)
			{
				System.out.println("network monitor exit, " + e.getReason());
				synchronized (NetworkMonitor.this) {
					NetworkMonitor.this.notify();
				}
			}
		});
	}
116227
def _on_connection_made(self):
        
        if self.username is not None and self.password is not None and self.kik_node is not None:
            # we have all required credentials, we can authenticate
            log.info("[+] Establishing authenticated connection using kik node '{}'...".format(self.kik_node))

            message = login.EstablishAuthenticatedSessionRequest(self.kik_node, self.username, self.password, self.device_id_override)
            self.initial_connection_payload = message.serialize()
        else:
            self.initial_connection_payload = '<k anon="">'.encode()

        self.connection.send_raw_data(self.initial_connection_payload)
966086
def _onmessage(cls, kmsg):
        
        logger.debug(
            "{}.ReceivedMessage {}[{}]".format(
                cls.__name__, kmsg.entrypoint, kmsg.uuid
            ),
            extra=dict(kmsg=kmsg.dump())
        )
        return cls.onmessage(kmsg)
1207795
def create_device(device_args):
    
    device = AlarmDecoder(USBDevice.find(device_args))
    device.on_message += handle_message
    device.open()

    return device