seelog

package module
v0.0.0-...-e7ac7be Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 24, 2020 License: MIT Imports: 13 Imported by: 0

README

seelog blog Open Source Love License

有了seelog,妈妈再也不用担心我登录服务器查看日志le...
项目地址:https://github.com/xmge/seelog
演示地址:http://seelog.xmge.top/password 欢迎各位gopher使用指正😃

项目背景

A:我去😕,,程序又出问题了,你去看看日志到底是哪里错啦
B:好好好,我马上登陆服务器看看
B:对啦,服务器密码是啥来着....
A:😰 密码是 &#¥&@~
B:额,日志文件在哪呢
A:...................
C:要不项目集成seelog吧,集成特别简单,集成后直接打开浏览器就能看日志了

项目介绍
  • 与golang项目集成、提供浏览器实时查看日志的功能,类似 tail -f xxx.log
  • 支持监控多个日志文件
  • 支持多浏览器同时访问
  • 支持密码认证
  • 支持浏览器 websocket 断线重连
  • 支持暂停、清屏、截图、过滤功能
  • 查找功能可直接使用浏览器 Ctrl+F 来完成
集成方式
  • 在项目中引入seelog, go get github.com/xmge/seelog
  • 在代码中引用
	seelog.See("错误日志","err.log")   // 检测 err.log
	seelog.See("调试日志","debug.log") // 检测 debug.log
	seelog.Serve(9000,"password")
  • 在浏览器中访问 http://host:port/{password}
项目展示

image

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Page403 = `` /* 16196-byte string literal not displayed */
View Source
var PageIndex = `` /* 18476-byte string literal not displayed */

Functions

func BlockUntilExists

func BlockUntilExists(fileName string, ctx context.Context) (os.FileInfo, error)

func GetPageHandler

func GetPageHandler() http.Handler

GetPageHandler return web view page for log, based on websocket handler in path of ws

func GetWsHandler

func GetWsHandler() http.Handler

GetWsHandler return websocket handler for custom ws integration

func See

func See(name, path string)

启动seelog

func Serve

func Serve(port int, password string)

开始监控

func StartMonitor

func StartMonitor()

开始监控,不启动Http Handler

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL