Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

git.hpds.cc/component/logging

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

git.hpds.cc/component/logging

  • v0.0.0-20230106105738-e378e873921b
  • Go
  • Socket score

Version published
Created
Source

logging

日志组件

使用说明

日志组件封装了uber/zap,使用基本一致

package main

import(
    "git.hpds.cc/Component/logging"
    
    "go.uber.org/zap/zap"
)

func main(){
    logger := LoadLoggerConfig()
    logger.Info("this is a test log")
    //也可以这样直接使用
    
    logging.L().Info("this is a test log")
}

// LoadLoggerConfig 加载日志配置
func LoadLoggerConfig() *logging.Logger {
	return logging.NewLogger(
		logging.SetPath("./log/"),
		logging.SetPrefix(""),
		logging.SetDevelopment(true),
		logging.SetDebugFileSuffix(""),
		logging.SetWarnFileSuffix(""),
		logging.SetErrorFileSuffix(""),
		logging.SetInfoFileSuffix(""),
		logging.SetMaxAge(30),
		logging.SetMaxBackups(100),
		logging.SetMaxSize(100),
		logging.SetLevel(logging.LogLevel["debug"]),
	)
}

FAQs

Package last updated on 06 Jan 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc