Golog
Simple logging framework for go.
Install / Use
/learn @moovweb/GologREADME
golog
by Manoj Dayaram, Zhigang Chen
Other than a palindrom, golog is a simple logging framework for Go that makes use of Go's concurrency features such as channels and go routines. In essence, all log messages are sent to a single global channel, and a single go routine listens on this channel and writes everything it receives.
This guarantees that all log writes a serialized without the need of excessive locking.
Getting Started
Getting started is pretty easy. Simply create a new logger and add processors that you are interested to log to.
import "golog"
...
console := golog.NewConsoleProcessor(golog.LOG_INFO, verboseBoolean) // only log messages more important than or equal to info.
logger := golog.NewLogger("some prefix here: ")
logger.AddProcessor("ConsoleLogger", console) // "ConsoleLogger" is name for the logger
...
logger.Infof("Hey, listen...")
logger.Warningf("Logging some crazy stuff here!")
Future Work
- Better formatting support (right now one has to implement a new LogProcessor)
- Rolling file loggers.
- Unique channel + go routine per resource (such as different files, stdout, syslog, etc...). This will allow writes to any single resource to be serialized, but writes to different resources to be parallelized.
Related Skills
node-connect
347.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
108.0kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
347.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
347.2kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
