Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
G
gost
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
gost
Commits
f588c76e
Commit
f588c76e
authored
Jul 27, 2017
by
rui.zheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update vendor
parent
212412fe
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
118 additions
and
0 deletions
+118
-0
vendor/github.com/go-log/log/LICENSE
vendor/github.com/go-log/log/LICENSE
+19
-0
vendor/github.com/go-log/log/README.md
vendor/github.com/go-log/log/README.md
+63
-0
vendor/github.com/go-log/log/log.go
vendor/github.com/go-log/log/log.go
+30
-0
vendor/vendor.json
vendor/vendor.json
+6
-0
No files found.
vendor/github.com/go-log/log/LICENSE
0 → 100644
View file @
f588c76e
Copyright (c) 2017 Go Log
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.
vendor/github.com/go-log/log/README.md
0 → 100644
View file @
f588c76e
# Log [](https://godoc.org/github.com/go-log/log)
Log is a logging interface for Go. That's it. Pass around the interface.
## Rationale
Users want to standardise logging. Sometimes libraries log. We leave the underlying logging implementation to the user
while allowing libraries to log by simply expecting something that satisfies the Logger interface. This leaves
the user free to pre-configure structure, output, etc.
## Interface
The interface is minimalistic on purpose
```
go
type
Logger
interface
{
Log
(
v
...
interface
{})
Logf
(
format
string
,
v
...
interface
{})
}
```
## Example
Here's a logger that uses logrus and logs with predefined fields.
```
go
import
(
"github.com/go-log/log"
"github.com/sirupsen/logrus"
)
type
logrusLogger
struct
{
*
logrus
.
Entry
}
func
(
l
*
logrusLogger
)
Log
(
v
...
interface
{})
{
l
.
Entry
.
Print
(
v
...
)
}
func
(
l
*
logrusLogger
)
Logf
(
format
string
,
v
...
interface
{})
{
l
.
Entry
.
Printf
(
format
,
v
...
)
}
func
WithFields
(
f
logrus
.
Fields
)
log
.
Logger
{
return
&
logrusLogger
{
logrus
.
WithFields
(
f
)}
}
```
The
`WithFields`
func returns a struct that satisfies the Logger interface.
Pre-configure a logger using WithFields and pass it as an option to a library.
```
go
import
"github.com/lib/foo"
l
:=
mylogger
.
WithFields
(
logrus
.
Fields
{
"library"
:
"github.com/lib/foo"
,
})
f
:=
foo
.
New
(
foo
.
WithLogger
(
l
),
)
```
vendor/github.com/go-log/log/log.go
0 → 100644
View file @
f588c76e
// Package log provides a log interface
package
log
// Logger is a generic logging interface
type
Logger
interface
{
Log
(
v
...
interface
{})
Logf
(
format
string
,
v
...
interface
{})
}
var
(
// The global default logger
DefaultLogger
Logger
=
&
noOpLogger
{}
)
// noOpLogger is used as a placeholder for the default logger
type
noOpLogger
struct
{}
func
(
n
*
noOpLogger
)
Log
(
v
...
interface
{})
{}
func
(
n
*
noOpLogger
)
Logf
(
format
string
,
v
...
interface
{})
{}
// Log logs using the default logger
func
Log
(
v
...
interface
{})
{
DefaultLogger
.
Log
(
v
...
)
}
// Logf logs formatted using the default logger
func
Logf
(
format
string
,
v
...
interface
{})
{
DefaultLogger
.
Logf
(
format
,
v
...
)
}
vendor/vendor.json
View file @
f588c76e
...
...
@@ -33,6 +33,12 @@
"revision"
:
"f90acb425616767b84789d10e50a6fb652cd1e9a"
,
"revisionTime"
:
"2017-02-05T06:05:58Z"
},
{
"checksumSHA1"
:
"fBx0fqiyrl26gkGo14J9pJ8zB2Y="
,
"path"
:
"github.com/go-log/log"
,
"revision"
:
"37e2e1f19306361e1fc152a1839f1236149cb4e4"
,
"revisionTime"
:
"2017-05-15T17:08:25Z"
},
{
"checksumSHA1"
:
"URsJa4y/sUUw/STmbeYx9EKqaYE="
,
"path"
:
"github.com/golang/glog"
,
...
...
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