nuveo / log Goto Github PK
View Code? Open in Web Editor NEWA simple to use log system, minimalist but with features for debugging and differentiation of messages
License: MIT License
A simple to use log system, minimalist but with features for debugging and differentiation of messages
License: MIT License
If the size of the output line is greater than the size indicated by a configuration variable the log line is cut and them adds "..." at the end.
The default value for the maximum line length is 2000 characters (equivalent to a 25-line, 80-column display)
The output time is hard coded defined to use the 0000/00/00 00: 00: 00
format. I want to be able to format it any way I want.
My idea:
import (
"github.com/nuveo/log"
}
func init {
log.Settings.TimestampFormat = "0000-00-00T00:00:00.0000"
}
func main {}
Sometimes we need to use JSON format logs for some reasons. In my case I want to use it because I use Filebeat together with Logstash, so I can see the logs on Kibana.
My ideia is implement something like this:
import (
"github.com/nuveo/log"
}
type MyStruct struct {
// ...
}
func init {
log.OutputFormat = log.JSONOutputFormat
}
func main {
log.Debugln(MyStruct{...})
}
Result
{
"datetime": "2017-08-01T00:00:00.0000",
"data": {
"MyStruct here"
}
}
linha 202 e 209: now().UTC().Format(TimeFormat) isso está matando o timezone e definindo tudo com UTC,
removi a função do UTC e ficou assim now().Format(TimeFormat), ai ele manteve o timezone padrao.
Hey!
I'm writing a adapter to use the log
pkg instead of fmt
, so I can redirect it to a buffer and test it, and I stepped into a 'problem' which are represented by these steps:
So I believe that the best behavior would be to export it, so we can use it outside.
We could also support formatting functions, for example log.Printf('some info: ', info)
.
When I run tests on master
I receive the following error:
--- FAIL: TestLog (0.00s)
log_test.go:97: Error, 'Debugln' printed "\x1b[96m2017/06/25 15:49:04 [debug] log_test.go:77 log test\x1b[0;00m\n", not match with expected
FAIL
Guys,
I'm seeing this error when I write log.Println()
: possible formatting directive in Println.
The solution is changing this method name, ref: https://github.com/derekparker/delve/issues/783
This package is cool, but have no usage examples. We need to add some usage examples.
We need name more groundhog
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.