Skip to content

日志

开启日志

ts
import MongoCore from 'mango-core'

MongoCore.init({
  businessPath: 'src',
  controllerPath: 'modules',
  name: 'Mango elysia',
  version: '1.0.0',
  swagger: {},
  logger: {
    type: 'fancy'
  }
}).listen(8899)

参数

loger继承于logestic,提供了默认三种类型

属性类型默认值描述
type`"fancy""common""commontz"`
destBunFile-存储地址, example: Bun.file('server.log')
showLevelbooleantrue显示日志级别
logLevelColourLogLevelColour-分别设置各个级别日志的颜色
explicitLoggingbooleantrue是否允许显式创建的日志
httpLoggingbooleantrue是否记录所有传入的 HTTP 请求