Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
b66b2609
Commit
b66b2609
authored
Oct 20, 2014
by
Juan Batiz-Benet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nicer, greppable logging
parent
c070c2f0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
util/log.go
util/log.go
+4
-2
No files found.
util/log.go
View file @
b66b2609
...
...
@@ -14,11 +14,13 @@ func init() {
var
log
=
Logger
(
"util"
)
var
ansiGray
=
"
\0
33[0;37m"
var
ansiBlue
=
"
\0
33[0;34m"
// LogFormats is a map of formats used for our logger, keyed by name.
var
LogFormats
=
map
[
string
]
string
{
"default"
:
"%{color}%{time:2006-01-02 15:04:05.999999} %{level} %{shortfile}: %{color:reset}%{message}"
,
"color"
:
ansiGray
+
"%{time:15:04:05.999} %{color}%{level}: %{color:reset}%{message} "
+
ansiGray
+
"%{shortfile}%{color:reset}"
,
"default"
:
"%{color}%{time:2006-01-02 15:04:05.000000} %{level} %{module} %{shortfile}: %{color:reset}%{message}"
,
"color"
:
ansiGray
+
"%{time:15:04:05.000} %{color}%{level:5.5s} "
+
ansiBlue
+
"%{module:10.10s}: %{color:reset}%{message} "
+
ansiGray
+
"%{shortfile}%{color:reset}"
,
}
// Logging environment variables
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment