Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/lcaballero/evil-ent

Logging interface library.
https://github.com/lcaballero/evil-ent

Last synced: 23 days ago
JSON representation

Logging interface library.

Awesome Lists containing this project

README

        

# Introduction

A printing/logging super-interface. See `log_interface.go`.

At this point there is only one implementation to the interface that
is backed by the [seelog](https://github.com/cihub/seelog) library.

See usage below.

## Impetus

There's a logger built into the Golang SDK. This logger might not
meet all the requirements for your application and so throughout your
application you might need to import and use some other library.

Once enough developers begin to work on the application some use the
built in logger (which doesn't meet requirements), and as deadlines
approach some forget the rule as they try to flesh out raw ideas.

Either way if the team aggrees to use a single inteface (like this
one) then a pre-push, or test, could be written to make sure the 'bad'
imports stay out of the application, while the imports for 'this' lib
are white-listed.

## Summary

This library provides a super-interface for all the console writing an
application might attempt, so that instead of importing fmt, log, or
some-log-lib, etc a single interface can be used and injected into
application code. At which point imports can be scanned to gaurantee
that the application code doesn't use any unwanted log or printing
imports.

## Usage

```
import "github.com/lcaballero/evil-ent/ent/seelog"

...

log, err := seelog.NewSeeLogWriter("seelog.xml")
if err != nil {
panic(err)
}

// pass log to the rest of the application, set global, etc.
```

## License

See license file.

The use and distribution terms for this software are covered by the
[Eclipse Public License 1.0][EPL-1], which can be found in the file 'license' at the
root of this distribution. By using this software in any fashion, you are
agreeing to be bound by the terms of this license. You must not remove this
notice, or any other, from this software.

[EPL-1]: http://opensource.org/licenses/eclipse-1.0.txt