2 Star 3 Fork 1

xuri / glc

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
contribute
Sync branch
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README
MIT
GLC (glog cleaner)

GLC (glog cleaner)

Build Status Code Coverage Go Report Card go.dev license Donate FOSSA Status

Overview

GLC (glog cleaner) is a log clear for glog written in Go. This library support for deleting old logs. There are tools which can be run to do the cleanup such as logrotate, but logrotate can't runs on Windows and embedded system, so we need a cross platform library to rotate the log.

Installation

go get github.com/xuri/glc

Usage

Here is a example usage that will do check every hour and clean the log files that creation time older than 30 minutes.

glc.NewGLC(glc.InitOption{
	Path:     path,
	Prefix:   `glc`,
	Interval: time.Duration(time.Hour),
	Reserve:  time.Duration(time.Minute * 30),
})

Contributing

Contributions are welcome! Open a pull request to fix a bug, or open an issue to discuss a new feature or change.

Licenses

This program is under the terms of the MIT License. See LICENSE for the full license text.

FOSSA Status

The MIT License (MIT) Copyright (c) 2016 - 2020 Ri Xu All rights reserved. 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.

About

GLC (glog cleaner) is a log clear for glog written in Go. This library support for deleting old logs. expand collapse
Go
MIT
Cancel

Releases

No release

Contributors

All

Activities

Load More
can not load any more
Go
1
https://gitee.com/xurime/glc.git
git@gitee.com:xurime/glc.git
xurime
glc
glc
master

Search

53164aa7 5694891 3bd8fe86 5694891