[QS] comments
This commit is contained in:
parent
801148e7d0
commit
d780555556
|
@ -13,7 +13,7 @@ import (
|
|||
)
|
||||
|
||||
// Function to test the writing into a http response
|
||||
// Input: pointer to testing object T
|
||||
// Input: pointer to testing object
|
||||
func TestWrite(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
|
||||
|
@ -38,7 +38,7 @@ func TestWrite(t *testing.T) {
|
|||
}
|
||||
|
||||
// Function to test the reading from a http response
|
||||
// Input: pointer to testing object T
|
||||
// Input: pointer to testing object
|
||||
func TestRead(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ import (
|
|||
)
|
||||
|
||||
// Function to the the permission and it's error handling
|
||||
// Input: pointer to testing object T
|
||||
// Input: pointer to testing object
|
||||
func TestPermission(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// Package log provides the
|
||||
// functionality to start und initialize to logger
|
||||
package log
|
||||
|
||||
import (
|
||||
|
@ -11,13 +13,14 @@ var Log *logger.Logger
|
|||
|
||||
type Logger logger.Entry
|
||||
|
||||
// Function to initiate a new logger
|
||||
func init() {
|
||||
Log = logger.New()
|
||||
// Enable fallback if core logger is used:
|
||||
log.SetOutput(Log.Writer())
|
||||
log.SetOutput(Log.Writer()) // Enable fallback if core logger
|
||||
}
|
||||
|
||||
// HTTP to add information of a httprequest to log
|
||||
// Function to add the information of a http request to the log
|
||||
// Input: pointer to the http request r
|
||||
func HTTP(r *http.Request) *logger.Entry {
|
||||
ip := r.Header.Get("X-Forwarded-For")
|
||||
if len(ip) <= 1 {
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// Package log provides the
|
||||
// functionality to start und initialize to logger
|
||||
package log
|
||||
|
||||
import (
|
||||
|
@ -7,6 +9,8 @@ import (
|
|||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
// Function to test the logging
|
||||
// Input: pointer to teh testing object
|
||||
func TestLog(t *testing.T) {
|
||||
assertion := assert.New(t)
|
||||
|
||||
|
|
Reference in New Issue