当前位置: 首页>>代码示例>>Python>>正文


Python log.info方法代码示例

本文整理汇总了Python中util.log.info方法的典型用法代码示例。如果您正苦于以下问题:Python log.info方法的具体用法?Python log.info怎么用?Python log.info使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在util.log的用法示例。


在下文中一共展示了log.info方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: router

# 需要导入模块: from util import log [as 别名]
# 或者: from util.log import info [as 别名]
def router (args):
    if len(args) < 2:
        log.error('MM:00 ROUTER: ERROR: usage: router arg arg ...')
        return
    host = args[0]
    if host not in bgprouters:
        log.error('MM:' + host + ' ERROR: ' + 'ROUTER' + ' ' + host + ' : must be a BGP router')
        return
    del args[0]
    cmd = ''
    for arg in args:
        cmd += '"' + arg + '" '
    log.info('MM:' + host + ' ROUTER: ' + cmd)
    r = generic(host, 'ROUTER', 'router ' + cmd + '\n')
    if r is not None:
        log.debug('MM:' + host + ' ROUTER: output = \n' + r.strip())
        
# generic command interface to a tnode - send cmd, capture data
# return None id cannot connect or socket error
# return '' if no data 
开发者ID:sdn-ixp,项目名称:iSDX,代码行数:22,代码来源:tmgr.py

示例2: send

# 需要导入模块: from util import log [as 别名]
# 或者: from util.log import info [as 别名]
def send (args):
    if len(args) != 4:
        log.error('MM:00 SEND: ERROR usage: send source bind_addr dest_addr dest_port')
        return
    src = args[0]
    baddr = args[1]
    daddr = args[2]
    dport = args[3]
    if src not in hosts:
        log.error('MM:00 SEND: ERROR unknown src ' + src)
        return
    rand = str(random.randint(1000000000, 9999999999)) # must be 10 characters
    r = generic(src, 'TEST', 'test ' + rand + ' ' + baddr + ' ' + daddr + ' ' + str(dport) + '\n')
    if r is None:   # connection error
        return
    log.info('MM:' + src + ' SEND: ' + r.strip()) 
开发者ID:sdn-ixp,项目名称:iSDX,代码行数:18,代码来源:tmgr.py

示例3: test

# 需要导入模块: from util import log [as 别名]
# 或者: from util.log import info [as 别名]
def test (args):
    if len(args) == 0:
        print json.dumps(tests, indent=4, sort_keys=True)
        # log.error('MM:00 ERROR: TEST: usage: test test_name ...')
        return
    for arg in args:
        if arg not in tests:
            log.error('MM:00 ERROR: TEST: undefined test: ' + arg)
            return
    for arg in args:
        log.info('MM:00 INFO: TEST: ' + arg)
        for l in tests[arg]:
            parse(l)
    
# start listeners on one or more hosts, one or more ports
#listener                         all hosts, all ports
#listener host                    this host, all ports
#listener host bind port port     this host, this bind, these ports 
开发者ID:sdn-ixp,项目名称:iSDX,代码行数:20,代码来源:tmgr.py

示例4: announce

# 需要导入模块: from util import log [as 别名]
# 或者: from util.log import info [as 别名]
def announce (args):
    if len(args) < 2:
        log.error('MM:XX' + ' ERROR: usage: announce bgp_router network ...')
        return
    host = args[0]
    del args[0]
    nets = ''
    for arg in args:
        nets += ' ' + arg
    if host not in bgprouters:
        log.error('MM:' + host + ' ERROR: ' + 'ANNOUNCE' + ' ' + host + ' : must be a BGP router')
    log.info('MM:' + host + ' ANNOUNCE: ' + nets)
    r = generic(host, 'ANNOUNCE', 'announce ' + nets + '\n')
    if r is not None and len(r) > 0:
        log.info('MM:' + host + ' ANNOUNCE: ' + r.strip())
    
 
# withdraw a route 
开发者ID:sdn-ixp,项目名称:iSDX,代码行数:20,代码来源:tmgr.py

示例5: withdraw

# 需要导入模块: from util import log [as 别名]
# 或者: from util.log import info [as 别名]
def withdraw (args):
    if len(args) < 2:
        log.error('MM:XX' + ' ERROR: usage: withdraw bgp_router network ...')
        return
    host = args[0]
    del args[0]
    nets = ''
    for arg in args:
        nets += ' ' + arg
    if host not in bgprouters:
        log.error('MM:' + host + ' ERROR: ' + 'WITHDRAW' + ' ' + host + ' : must be a BGP router')
    log.info('MM:' + host + ' WITHDRAW: ' + nets)
    r = generic(host, 'WITHDRAW', 'withdraw ' + nets + '\n')
    if r is not None and len(r) > 0:
        log.info('MM:' + host + ' WITHDRAW: ' + r.strip())
        
# display bgp routes 
开发者ID:sdn-ixp,项目名称:iSDX,代码行数:19,代码来源:tmgr.py

示例6: log_step_message

# 需要导入模块: from util import log [as 别名]
# 或者: from util.log import info [as 别名]
def log_step_message(self, step, accuracy, d_loss, g_loss, 
                         s_loss, step_time, is_train=True):
        if step_time == 0: step_time = 0.001
        log_fn = (is_train and log.info or log.infov)
        log_fn((" [{split_mode:5s} step {step:4d}] " +
                "Supervised loss: {s_loss:.5f} " +
                "D loss: {d_loss:.5f} " +
                "G loss: {g_loss:.5f} " +
                "Accuracy: {accuracy:.5f} "
                "({sec_per_batch:.3f} sec/batch, {instance_per_sec:.3f} instances/sec) "
                ).format(split_mode=(is_train and 'train' or 'val'),
                         step = step,
                         d_loss = d_loss,
                         g_loss = g_loss,
                         s_loss = s_loss,
                         accuracy = accuracy,
                         sec_per_batch = step_time,
                         instance_per_sec = self.batch_size / step_time
                         )
               ) 
开发者ID:clvrai,项目名称:SSGAN-Tensorflow,代码行数:22,代码来源:trainer.py

示例7: __call__

# 需要导入模块: from util import log [as 别名]
# 或者: from util.log import info [as 别名]
def __call__(self, input):
        with tf.variable_scope(self.name, reuse=self._reuse):
            if not self._reuse:
                print('\033[93m'+self.name+'\033[0m')
            _ = input
            num_channel = [32, 64, 128, 256, 256, 512]
            num_layer = np.ceil(np.log2(min(_.shape.as_list()[1:3]))).astype(np.int)
            for i in range(num_layer):
                ch = num_channel[i] if i < len(num_channel) else 512
                _ = conv2d(_, ch, self._is_train, info=not self._reuse,
                           norm=self._norm_type, name='conv{}'.format(i+1))
            _ = conv2d(_, int(num_channel[i]/4), self._is_train, k=1, s=1,
                       info=not self._reuse, norm='None', name='conv{}'.format(i+2))
            _ = conv2d(_, self._num_class+1, self._is_train, k=1, s=1, info=not self._reuse,
                       activation_fn=None, norm='None',
                       name='conv{}'.format(i+3))
            _ = tf.squeeze(_)
            if not self._reuse: 
                log.info('discriminator output {}'.format(_.shape.as_list()))
            self._reuse = True
            self.var_list = tf.get_collection(tf.GraphKeys.TRAINABLE_VARIABLES, self.name)
            return tf.nn.sigmoid(_), _ 
开发者ID:clvrai,项目名称:SSGAN-Tensorflow,代码行数:24,代码来源:discriminator.py

示例8: log_step_message

# 需要导入模块: from util import log [as 别名]
# 或者: from util.log import info [as 别名]
def log_step_message(self, step, loss, loss_g_update,
                         loss_z_update, step_time, is_train=True):
        if step_time == 0:
            step_time = 0.001
        log_fn = (is_train and log.info or log.infov)
        log_fn((" [{split_mode:5s} step {step:4d}] " +
                "Loss: {loss:.5f} " +
                "G update: {loss_g_update:.5f} " +
                "Z update: {loss_z_update:.5f} " +
                "({sec_per_batch:.3f} sec/batch, {instance_per_sec:.3f} instances/sec) "
                ).format(split_mode=(is_train and 'train' or 'val'),
                         step=step,
                         loss=loss,
                         loss_z_update=loss_z_update,
                         loss_g_update=loss_g_update,
                         sec_per_batch=step_time,
                         instance_per_sec=self.batch_size / step_time
                         )
               ) 
开发者ID:clvrai,项目名称:Generative-Latent-Optimization-Tensorflow,代码行数:21,代码来源:trainer.py

示例9: __init__

# 需要导入模块: from util import log [as 别名]
# 或者: from util.log import info [as 别名]
def __init__(self, ids, name='default',
                 max_examples=None, is_train=True):
        self._ids = list(ids)
        self.name = name
        self.is_train = is_train

        if max_examples is not None:
            self._ids = self._ids[:max_examples]

        filename = 'data.hdf5'

        file = os.path.join(__PATH__, filename)
        log.info("Reading %s ...", file)

        try:
            self.data = h5py.File(file, 'r+')
        except:
            raise IOError('Dataset not found. Please make sure the dataset was downloaded.')
        log.info("Reading Done: %s", file) 
开发者ID:clvrai,项目名称:Generative-Latent-Optimization-Tensorflow,代码行数:21,代码来源:svhn.py

示例10: log_step_message

# 需要导入模块: from util import log [as 别名]
# 或者: from util.log import info [as 别名]
def log_step_message(self, step, loss, loss_pair,
                         loss_unpair, step_time, is_train=True):
        if step_time == 0:
            step_time = 0.001
        log_fn = (is_train and log.info or log.infov)
        log_fn((" [{split_mode:5s} step {step:4d}] " +
                "Loss: {loss:.5f} " +
                "Loss pair: {loss_pair:.5f} " +
                "Loss unpair: {loss_unpair:.5f} " +
                "({sec_per_batch:.3f} sec/batch, {instance_per_sec:.3f} instances/sec) "
                ).format(split_mode=(is_train and 'train' or 'val'),
                         step=step,
                         loss=loss,
                         loss_pair=loss_pair,
                         loss_unpair=loss_unpair,
                         sec_per_batch=step_time,
                         instance_per_sec=self.batch_size / step_time
                         )
               ) 
开发者ID:clvrai,项目名称:Representation-Learning-by-Learning-to-Count,代码行数:21,代码来源:trainer.py

示例11: __init__

# 需要导入模块: from util import log [as 别名]
# 或者: from util.log import info [as 别名]
def __init__(self, ids, name='default',
                 max_examples=None, is_train=True):
        self._ids = list(ids)
        self.name = name
        self.is_train = is_train

        if max_examples is not None:
            self._ids = self._ids[:max_examples]

        file = os.path.join(__IMAGENET_IMG_PATH__, self._ids[0])

        try:
            imread(file)
        except:
            raise IOError('Dataset not found. Please make sure the dataset was downloaded.')
        log.info("Reading Done: %s", file) 
开发者ID:clvrai,项目名称:Representation-Learning-by-Learning-to-Count,代码行数:18,代码来源:ImageNet.py

示例12: log_step_message

# 需要导入模块: from util import log [as 别名]
# 或者: from util.log import info [as 别名]
def log_step_message(self, step, loss, accuracy, step_time, is_train=True):
        if step_time == 0:
            step_time = 0.001
        log_fn = (is_train and log.info or log.infov)
        log_fn((" [{split_mode:5s} step {step:4d}] " +
                "Loss: {loss:.5f} " +
                "Accuracy: {accuracy:.5f} " +
                "({sec_per_batch:.3f} sec/batch, {instance_per_sec:.3f} instances/sec) "
                ).format(split_mode=(is_train and 'train' or 'val'),
                         step=step,
                         loss=loss,
                         accuracy=accuracy,
                         sec_per_batch=step_time,
                         instance_per_sec=self.batch_size / step_time
                         )
               ) 
开发者ID:clvrai,项目名称:Representation-Learning-by-Learning-to-Count,代码行数:18,代码来源:trainer_classifier.py

示例13: log_step_message

# 需要导入模块: from util import log [as 别名]
# 或者: from util.log import info [as 别名]
def log_step_message(self, step, p_loss, f_loss, loss, step_time, is_train=True):
        if step_time == 0: step_time = 0.001
        log_fn = (is_train and log.info or log.infov)
        log_fn((" [{split_mode:5s} step {step:4d}] " +
                "Loss: {loss:.5f} " +
                "Pixel loss: {p_loss:.5f} " +
                "Flow loss: {f_loss:.5f} " +
                "({sec_per_batch:.3f} sec/batch, {instance_per_sec:.3f} instances/sec) "
                ).format(split_mode=(is_train and 'train' or 'val'),
                         step=step,
                         loss=loss,
                         p_loss=p_loss,
                         f_loss=f_loss,
                         sec_per_batch=step_time,
                         instance_per_sec=self.batch_size / step_time
                         )
               ) 
开发者ID:shaohua0116,项目名称:Multiview2Novelview,代码行数:19,代码来源:trainer.py

示例14: __init__

# 需要导入模块: from util import log [as 别名]
# 或者: from util.log import info [as 别名]
def __init__(self, ids, n, scene_class, name='default',
                 max_examples=None, is_train=True, bound=10):
        self._ids = list(ids)
        self.name = name
        self.is_train = is_train
        self.n = n
        self.bound = bound

        if max_examples is not None:
            self._ids = self._ids[:max_examples]

        filename = 'data_{}.hdf5'.format(scene_class)

        file = osp.join('./datasets/{}'.format(scene_class), filename)
        log.info("Reading %s ...", file)

        self.data = h5py.File(file, 'r')
        log.info("Reading Done: %s", file) 
开发者ID:shaohua0116,项目名称:Multiview2Novelview,代码行数:20,代码来源:scene_loader.py

示例15: __init__

# 需要导入模块: from util import log [as 别名]
# 或者: from util.log import info [as 别名]
def __init__(self, ids, n, object_class, name='default',
                 max_examples=None, is_train=True):
        self._ids = list(ids)
        self.name = name
        self.is_train = is_train
        self.n = n
        self.bound = int(360/ang_interval+1)

        if max_examples is not None:
            self._ids = self._ids[:max_examples]

        filename = 'data_{}.hdf5'.format(object_class)

        file = osp.join(__PATH__, filename)
        log.info("Reading %s ...", file)

        self.data = h5py.File(file, 'r')
        log.info("Reading Done: %s", file) 
开发者ID:shaohua0116,项目名称:Multiview2Novelview,代码行数:20,代码来源:object_loader.py


注:本文中的util.log.info方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。