Acid JS - Log :traffic_light:
带有配置选项的简单记录器。
注意:选项配置为 YAML - Live Demo
Install
npm install @acidjs/log
Usage
// index.js
const log = require('@acidjs/log')(require('@acidjs/config'))
log.error('you made a mistake bruh...')
log.warning('ill let it slide this time?')
log.success('wow you got it right!')
console.log('wow such basic...')
In order for the above code要工作,我们需要设置我们的配置。 log.error(), log.warning() 等。直到我们在 .acid/config.yml
中定义它时才会存在
注意:根据需要创建尽可能多的 log.types . 最低要求是前缀
。
# .acid/config.yml
log:
prefix: acid
console:
on: true
exclude: []
type:
error:
prefix: error
color: red
bold: true
warning:
prefix: warning
color: yellow
bold: true
success:
prefix: success
color: green
bold: true
output:
可用颜色:
- black
- red
- green
- yellow
- blue
- magenta
- cyan
- white
- gray
License
MIT 许可证
版权所有 (c) 2020 Michael Arakilian
特此免费向任何获得副本的人授予许可
本软件和相关文档文件(“软件”),处理
在软件中不受限制,包括但不限于权利
使用、复制、修改、合并、发布、分发、再许可和/或出售
该软件的副本,并允许该软件是
提供这样做,但须满足以下条件:
上述版权声明和本许可声明应包含在所有
软件的副本或重要部分。
本软件“按原样”提供,不提供任何形式的明示或保证
暗示的,包括但不限于适销性保证,
适用于特定目的和非侵权。 在任何情况下都不得
作者或版权持有人对任何索赔、损害或其他
责任,无论是在合同、侵权或其他方面的行为中,由以下原因引起,
出于或与软件或使用或其他交易有关
软件。
Acid JS - Log :traffic_light:
Simple logger with configuration options.
Note: options are configured with YAML - Live Demo
Install
npm install @acidjs/log
Usage
// index.js
const log = require('@acidjs/log')(require('@acidjs/config'))
log.error('you made a mistake bruh...')
log.warning('ill let it slide this time?')
log.success('wow you got it right!')
console.log('wow such basic...')
In order for the above code to work, we need to set our configurations. log.error(), log.warning() etc.. doesn't exist until we define it in .acid/config.yml
Note: create as many log.types as you like. The minimum requirement is a prefix
.
# .acid/config.yml
log:
prefix: acid
console:
on: true
exclude: []
type:
error:
prefix: error
color: red
bold: true
warning:
prefix: warning
color: yellow
bold: true
success:
prefix: success
color: green
bold: true
output:
Available colors:
- black
- red
- green
- yellow
- blue
- magenta
- cyan
- white
- gray
License
MIT License
Copyright (c) 2020 Michael Arakilian
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.