open-index/open-npm huggingface dataset:
npm package: @gaoding/hlg-logger
Description: A Logger client based on debug, mini-logger and logcenter
Author: xiaomi
Latest version: 1.1.1

# Node.js Logger Client

## 安装

```
npm install @gaoding/hlg-logger
```


## 基本用法

```javascript
const debug = require('debug');

const APP_NAME = process.env.APP_NAME;

const logger = require('@gaoding/hlg-logger').create({
    logServer: process.env.LOG_SERVER,
    app: APP_NAME
});

// log something
logger.info('message', metaData, type, module);
logger.warn('message', metaData, type, module);
logger.debug('message', metaData, type, module);
logger.error('message', metaData, type, module);

//metric
logger.metric(targets, labels, type, name);
```

## 继承
```javascript
const subLogger = logger.extend(extendsData, extConfig);
```
当有以下或更多需求时：

- 项目比较复杂
- 有多场景的需求
- 需要链路追踪的时候

可能会希望产生不同的日志，但日志有一些公共的配置是固定的，可以通过继承的方式创建对应的 subLogger。

可以通过已有的 logger，创建新的 subLogger, subLogger 会继承 logger 的所有配置，新的配置会覆盖 logger 原有的配置。
```javascript
const const logger = require('@gaoding/hlg-logger').create({
    logServer: process.env.LOG_SERVER,
    app: APP_NAME
});

// extend logger
const subLogger = logger.extend({
    traceId: 'xxx',
}, {
    app: SUB_APP_NAME,
    level: LEVEL,
});
subLogger.info('message', metaData, type, module);
subLogger.warn('message', metaData, type, module);
subLogger.debug('message', metaData, type, module);
subLogger.error('message', metaData, type, module);
```

## 配置


```javascript
const logger = require('@gaoding/hlg-logger').create({
    // server logger 目前只支持 UDP，支持 `url schema`，默认 `null`
    logServer: null,
    // local logger 打印日志到本地，默认 `null`，默认文件名 `{info|error}.YYYY-MM-DD.log`
    logDir: null,
    // 是否输出到标准输出，默认 `true`
    logStdio: true,
    // 是否开启花费时间记录，如果开启扩展数据内会增加 `elapsed`, `last_elapsed` 两个字段，默认 `false`
    logElapsed: false,
    // 本地主机名，默认取 `os.hostname()`
    host: '',
    // 应用名，默认 `app`
    app: 'app',
    // 模块名，默认空，可以在方法内指定
    module: '',
    // 类型，默认空，可以在方法内指定
    type: '',
    // 附加数据，默认 `null`
    metaData: null,
    // 日志输出级别, 默认 `ALL`
    level: 'ALL'
});
```


## API

- logger.info
- logger.error

> 待完善
npm package: @gaoding/hlg-metrics-v2
Description: Hlg metrics v2 sdk
Author: bocai
Latest version: 1.0.3

## Hlg-metrics-v2

Hlg metrics v2 Node SDK

### 配置说明

```json
{
  outputDebugLog: false,  // 是否输出调试日志，默认值：fasle。
  serverAddr: "",         // 服务器地址
  appName: "",            // 应用名称
  bufferSize: 5,          // 缓冲区大小，固定默认值：5。暂不提供修改配置
}
```
npm package: @gaoding/koa-isbot
Description: koa detect googlebot, facebookbot ...
Author: Van-Duyet Le
Latest version: 0.1.1

# koa-isbot [![Build Status](https://travis-ci.org/duyetdev/koa-isbot.svg?branch=master)](https://travis-ci.org/duyetdev/koa-isbot)

Koa detect robots. Fast Middleware detect bot crawler for Koa.

[![NPM](https://nodei.co/npm/koa-isbot.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/koa-isbot/)

# Installation

```sh
npm install koa-isbot --save 
```

# Usage

```js
var koa = require('koa')
  , app = koa.app()
  , isBot = require('koa-isbot');

app.use(isBot());

app.use(function *(next) {
    console.log('isBot? ', this.state.isBot); 
    // null or 'googlebot', 'bingbot', ...
});

app.listen(3000);
```

# Support list 

* Google bot - `googlebot`
* Baidu - `baiduspider`
* Guruji - `gurujibot`
* Yandex - `yandexbot`
* Slurp- `slurp`
* MSN - `msnbot`
* Bing - `bingbot`
* Facebook - `facebookexternalhit`
* Linkedin - `linkedinbot`
* Twitter - `twitterbot`
* Slack - `slackbot`
* Telegram - `telegrambot`
* Apple - `applebot`
* Pingdom - `pingdom`
* tumblr - `tumblr `

# How to contribute

1. Fork the project on Github
2. Create a topic branch for your changes
3. Ensure that you provide documentation and test coverage for your changes (patches won’t be accepted without)
4. Create a pull request on Github (these are also a great place to start a conversation around a patch as early as possible)

# License

MIT License

Copyright (c) 2016 Van-Duyet Le

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.