taobao.wangwang.eservice.loginlogs.get 获取登录日志
        
        通过用户id查询用户自己或者子账户的登录日志： 主账号可以查询自己和店铺子账户的登录日志 组管理员可以查询自己和组内子账号的登录日志 非组管理员的子账户只能查询自己的登录日志
187553
def loginlogs_get(self, service_staff_id, start_date, end_date, session):
        ''''''
        request = TOPRequest('taobao.wangwang.eservice.loginlogs.get')
        request['service_staff_id'] = service_staff_id
        request['start_date'] = start_date
        request['end_date'] = end_date
        self.create(self.execute(request, session))
        return self.loginlogs
573927
def timestamp_datetime(self, timestamp):
        
        format = '%Y-%m-%d %H:%M:%S'
        # timestamp为传入的值为时间戳(10位整数)，如：1332888820
        timestamp = time.localtime(timestamp)
        ## 经过localtime转换后变成
        ## time.struct_time(tm_year=2012, tm_mon=3, tm_mday=28, tm_hour=6, tm_min=53, tm_sec=40, tm_wday=2, tm_yday=88, tm_isdst=0)
        # 最后再经过strftime函数转换为正常日期格式。
        return time.strftime(format, timestamp)
1240123
function configLogger(path,level,transConfig,procs) {
    var trans = [],config = {},consoleOpt,fileOpt;

    //配置输出控制台的日志
    if(transConfig && transConfig.Console) {
        consoleOpt = _.merge(defaultOptions.Console,transConfig.Console);
        trans.push(new (winston.transports.Console)(consoleOpt));
    }
    //配置写文件的日志
    if(path) {
        defaultOptions.File.filename = path;
        if(transConfig && transConfig.File) {
            fileOpt = _.merge(defaultOptions.File,transConfig.File);
        } else {
            fileOpt = defaultOptions.File;
        }
        trans.push(new (winston.transports.File)(fileOpt));
    }

    //如果存在退出错误配置，进行设置
    if(transConfig && transConfig.exitOnError) {
        config.exitOnError = transConfig.exitOnError;
    } else {
        config.exitOnError = defaultOptions.exitOnError;
    }

    config.level = level?level:defaultOptions.level;
    config.transports = trans;
    if(procs) {
         config.rewriters = procs.rewriters||[];
         config.filters = procs.filters||[];
    }
   
    var logger = new (winston.Logger)(config);
    return logger;
}
371541
function () {

    var keys = Object.keys(wating);

    /*
     * 检测依赖关系，
     * FIXME 暂时未处理循环依赖.以及始终不满足执行条件的情况.
     */
    keys.forEach(function (name) {
        var args = [];
        var factory = wating[name][0];
        var depends = wating[name][1];
        var done = wating[name][2];

        var canDo = depends.every(function (name) {

            // 插件系统中内容优先，资源池中置后
            var value = working[name] || Resource[name];

            if (value) {
                args.push(value);
                return true;
            }

            return false;
        });

        if (canDo) {
            // 先移除，防止callback中检测依赖时产生的循环
            delete wating[name];

            //  判断异步及同步
            if (done) {
                args.push(done);
                factory.apply( {}, args);
            } else {
                try {
                    var value = working[name] = factory.apply( {}, args);

                    oldDefineOfPlugin.call(Plugin, name, value);
                }catch(err) {
                    stdLog(['%s, can not start the plug-in [%s], \nstack:', err.stack, name], 'crash');
                    process.exit(0);
                    return;
                }
            }
        }
    });
}
608188
function (logLevel, args) {
            const time = dateFormat(new Date(), 'dd/mm/yyyy, h:MM:ss.l tt');
            // Each logger can have its own name. If this is
            // not provided, it will default to Unknown.
            const loggerName = __private.name || Constants.LOG_UNKNOWN_APP_ID;
            return [ (logLevel.name.length === 4 ? ' ' : '') +
                getLogLabel(logLevel)('[' + logLevel.name + ']'), time, '-',
            loggerName.padEnd(Constants.LOG_APP_ID_WIDTH), ':'].concat(Object.values(args));
        }
652844
def ReqUserLogout(self):
        """"""

        self.q.Release()
        # 确保隔夜或重新登录时的第1个tick不被发送到客户端
        self.inst_tick.clear()
        self.logined = False
        threading.Thread(target=self.OnDisConnected, args=(self, 0)).start()
571430
function logtime() {
  var d = new Date()
    , space = ' '
    , delimiter = ':'
    , str = d.toString()
    , month = str.split(' ')[1];
  return d.getDate()
    + space + month + space
    + d.getHours() + delimiter
    + pad(d.getMinutes()) + delimiter
    + pad(d.getSeconds())
    + '.'
    + pad(d.getMilliseconds(), 3);
}
937805
public static function isLog($log_level)
    {
        if (self::$log_mode === null) {
            $log_mode_config = Config::getEnv("app.log_mode");
            if ($log_mode_config < 0 || $log_mode_config > 8) {
                throw new \InvalidArgumentException("日志模式必须是0到8之间的整数，请检查配置项:app.log_mode");
            }
            self::$log_mode = $log_mode_config;
        }

        if (self::$log_mode <= array_search($log_level, self::$log_level_allow)) {
            return true;
        }

        return false;
    }
1224475
def get_log(request):
    
    query = d1_gmn.app.models.EventLog.objects.all().order_by('timestamp', 'id')
    if not d1_gmn.app.auth.is_trusted_subject(request):
        query = d1_gmn.app.db_filter.add_access_policy_filter(
            request, query, 'sciobj__id'
        )
        query = d1_gmn.app.db_filter.add_redact_annotation(request, query)
    query = d1_gmn.app.db_filter.add_datetime_filter(
        request, query, 'timestamp', 'fromDate', 'gte'
    )
    query = d1_gmn.app.db_filter.add_datetime_filter(
        request, query, 'timestamp', 'toDate', 'lt'
    )
    query = d1_gmn.app.db_filter.add_string_filter(
        request, query, 'event__event', 'event'
    )
    if d1_gmn.app.views.util.is_v1_api(request):
        query = d1_gmn.app.db_filter.add_string_begins_with_filter(
            request, query, 'sciobj__pid__did', 'pidFilter'
        )
    elif d1_gmn.app.views.util.is_v2_api(request):
        query = d1_gmn.app.db_filter.add_sid_or_string_begins_with_filter(
            request, query, 'sciobj__pid__did', 'idFilter'
        )
    else:
        assert False, 'Unable to determine API version'
    total_int = query.count()
    query, start, count = d1_gmn.app.views.slice.add_slice_filter(
        request, query, total_int
    )
    return {
        'query': query,
        'start': start,
        'count': count,
        'total': total_int,
        'type': 'log',
    }
38362
def QA_SU_save_stock_day(client=DATABASE, ui_log=None, ui_progress=None):
    '''
     
    '''
    stock_list = QA_fetch_get_stock_list()
    # TODO: 重命名stock_day_ts
    coll_stock_day = client.stock_day_ts
    coll_stock_day.create_index(
        [("code",
          pymongo.ASCENDING),
         ("date_stamp",
          pymongo.ASCENDING)]
    )

    err = []
    num_stocks = len(stock_list)
    for index, ts_code in enumerate(stock_list):
        QA_util_log_info('The {} of Total {}'.format(index, num_stocks))

        strProgressToLog = 'DOWNLOAD PROGRESS {} {}'.format(
            str(float(index / num_stocks * 100))[0:4] + '%',
            ui_log
        )
        intProgressToLog = int(float(index / num_stocks * 100))
        QA_util_log_info(
            strProgressToLog,
            ui_log=ui_log,
            ui_progress=ui_progress,
            ui_progress_int_value=intProgressToLog
        )
        _saving_work(ts_code,
                     coll_stock_day,
                     ui_log=ui_log,
                     err=err)
        # 日线行情每分钟内最多调取200次，超过5000积分无限制
        time.sleep(0.005)

    if len(err) < 1:
        QA_util_log_info('SUCCESS save stock day ^_^', ui_log)
    else:
        QA_util_log_info('ERROR CODE \n ', ui_log)
        QA_util_log_info(err, ui_log)
442184
def run(self):
        
        # 如果出现了日期的改变 才会进行结算的事件
        _date = None

        while QA_util_if_tradetime(self.now):
            for data in self.ingest_data:  # 对于在ingest_data中的数据
                # <class 'QUANTAXIS.QAData.QADataStruct.QA_DataStruct_Stock_day'>
                date = data.date[0]
                if self.market_type is MARKET_TYPE.STOCK_CN:  # 如果是股票市场
                    if _date != date:  # 如果新的date
                        # 前一天的交易日已经过去
                        # 往 broker 和 account 发送 settle 事件
                        try:
                            self.market.trade_engine.join()
                            # time.sleep(2)
                            self.market._settle(self.broker_name)

                        except Exception as e:
                            raise e
                # 基金 指数 期货
                elif self.market_type in [MARKET_TYPE.FUND_CN, MARKET_TYPE.INDEX_CN, MARKET_TYPE.FUTURE_CN]:
                    self.market._settle(self.broker_name)
                # print(data)
                self.broker.run(
                    QA_Event(event_type=ENGINE_EVENT.UPCOMING_DATA, market_data=data))
                # 生成 UPCOMING_DATA 事件放到 队列中去执行

                self.market.upcoming_data(self.broker_name, data)

                self.market.trade_engine.join()

                _date = date
110439
function (logInst) {

	var log_id = logInst.id;

	// create index to buffer map, if not exist
	if (l_logBufferIdxByID.hasOwnProperty(log_id) === false)
		l_logBufferIdxByID[log_id] = [];

	l_logBufferIdxByID[log_id].push(logInst);

	l_logBuffer.enqueue(logInst,

		// callback to write log
		function (tmpLog) {

			// show notice if queued log exceeds limit (once each time multiples of the limit is reached)
			if ((l_logBuffer.getLength() > 0) && (l_logBuffer.getLength() % l_logBufferOverloadLimit === 0)) {
				console.log(l_name + '::l_writeLog::' + SR.Tags.YELLOW + 'log len=' + l_logBuffer.getLength() + SR.Tags.ERREND);
			}

			// lock individual log instance            
			if (l_logs.hasOwnProperty(tmpLog.id) === true) {
				// if we're busy writing now, wait till next time
				if (l_logs[tmpLog.id].writing === true)
					return false;

				// lock the writing for this id
				l_logs[tmpLog.id].writing = true;

				SR.fs.writeSync(tmpLog.fd, tmpLog.msg, undefined, undefined);

				// remove a flag record from topmost
				if (l_logBufferIdxByID.hasOwnProperty(tmpLog.id) === true)
					l_logBufferIdxByID[tmpLog.id].shift();

				l_logs[tmpLog.id].writing = false;
			}

			// NOTE: processing will pause here if id doesn't exist in l_logs
			// TODO: right behavior?
			return true;
		}
	);
}
756487
def login(self, user=None, password=None, **kwargs):
        
        cookies = kwargs.get('cookies')
        if cookies is None:
            raise TypeError('雪球登陆需要设置 cookies， 具体见'
                            'https://smalltool.github.io/2016/08/02/cookie/')
        headers = self._generate_headers()
        self.s.headers.update(headers)

        self.s.get(self.LOGIN_PAGE)

        cookie_dict = helpers.parse_cookies_str(cookies)
        self.s.cookies.update(cookie_dict)

        log.info('登录成功')
231166
private function _log($group, $level, $message, array $context = array())
    {
        if (!$this->options['enabled']) return false;
        
        $initLevel = strtoupper($this->options['level']);
        $optionLevelNum = isset(static::$levels[$initLevel]) ? static::$levels[$initLevel] : 400;
        
        $currentLevelNum = static::$levels[strtoupper($level)];
        
        /**
         * 当写入级别大于配置级别时才进行记录
         * 比如，配置级别为 Error，则调用 warning(), notice() 等不会进行记录
         */
        if ($currentLevelNum >= $optionLevelNum) {
            if (!static::$timezone) {
                static::$timezone = new \DateTimeZone(date_default_timezone_get() ?: 'PRC');
            }
            //$date = \DateTime::createFromFormat('U.u', sprintf('%.6F', microtime(true)), static::$timezone)->setTimezone(static::$timezone);
            //var_dump($date); exit;
            
            // 日志级别
            $level = strtolower($level);
            
            // 日志文件后缀，只对文件方式有效
            $file_ext = trim($this->getOption('file_ext'), '.');
            if (($pos = strrpos($file_ext, '.')) !== false) {
                $file_ext = substr($file_ext, $pos + 1);
            }
            $this->setOption('file_ext', $file_ext);
            
            // 日志内容
            $record = array(
                'datetime'  => date("Ymd H:i:s"),
                'level'     => $level,
                'message'   => $this->formatMessage($message),
                'context'   => $context
            );
            
            // key
            if (!($key = $this->getOption('file'))) {
                $key = date('Ymd');
            }
            
            // path: group_name/error/20161012.error.log
            $key = ($group ? $group . '/' : '') . $level . '/' . $key . '.' . $level;
            
            //$this->append($key, str_repeat('-', 50));
            return $this->append($key, $record);
        } else {
            return false;
        }
    }
1101135
def get(self, date, page_no=1, page_size=40, fields=[]):
        ''''''
        request = TOPRequest('taobao.taobaoke.items.get')
        request['date'] = date
        request['page_no'] = page_no
        request['page_size'] = page_size
        if not fields:
            fields = self.fields
        request['fields'] = fields
        self.create(self.execute(request)['taobaoke_report'])
        return self
172181
public static BizLogger getLogger(Level level, RemotingClientDelegate remotingClient, TaskTrackerAppContext appContext) {

        // 单元测试的时候返回 Mock
        if (Environment.UNIT_TEST == LTSConfig.getEnvironment()) {
            return new MockBizLogger(level);
        }

        String key = appContext.getConfig().getIdentity();
        BizLogger logger = BIZ_LOGGER_CONCURRENT_HASH_MAP.get(key);
        if (logger == null) {
            synchronized (BIZ_LOGGER_CONCURRENT_HASH_MAP) {
                logger = BIZ_LOGGER_CONCURRENT_HASH_MAP.get(key);
                if (logger != null) {
                    return logger;
                }
                logger = new BizLoggerImpl(level, remotingClient, appContext);

                BIZ_LOGGER_CONCURRENT_HASH_MAP.put(key, logger);
            }
        }
        return logger;
    }
354380
private void logInfo(@NonNull final Logger log) {
        log.i("App ver. = " + deviceDAO.device().getAppVer());
        log.i("Comapi device ID = " + deviceDAO.device().getDeviceId());
        log.d("Firebase ID = " + deviceDAO.device().getInstanceId());
    }