Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
f9560f94
Unverified
Commit
f9560f94
authored
Jan 16, 2019
by
Carl Bergquist
Committed by
GitHub
Jan 16, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #14885 from bergquist/remove_log2
removes global log 2 functions
parents
b7451bc7
3cd0cb3d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
26 deletions
+18
-26
pkg/components/imguploader/imguploader.go
+5
-2
pkg/log/log.go
+2
-20
pkg/login/ext_user.go
+5
-1
pkg/services/alerting/notifiers/telegram.go
+1
-1
pkg/services/alerting/test_notification.go
+5
-2
No files found.
pkg/components/imguploader/imguploader.go
View file @
f9560f94
...
@@ -6,7 +6,6 @@ import (
...
@@ -6,7 +6,6 @@ import (
"regexp"
"regexp"
"github.com/grafana/grafana/pkg/log"
"github.com/grafana/grafana/pkg/log"
"github.com/grafana/grafana/pkg/setting"
"github.com/grafana/grafana/pkg/setting"
)
)
...
@@ -21,6 +20,10 @@ func (NopImageUploader) Upload(ctx context.Context, path string) (string, error)
...
@@ -21,6 +20,10 @@ func (NopImageUploader) Upload(ctx context.Context, path string) (string, error)
return
""
,
nil
return
""
,
nil
}
}
var
(
logger
=
log
.
New
(
"imguploader"
)
)
func
NewImageUploader
()
(
ImageUploader
,
error
)
{
func
NewImageUploader
()
(
ImageUploader
,
error
)
{
switch
setting
.
ImageUploadProvider
{
switch
setting
.
ImageUploadProvider
{
...
@@ -94,7 +97,7 @@ func NewImageUploader() (ImageUploader, error) {
...
@@ -94,7 +97,7 @@ func NewImageUploader() (ImageUploader, error) {
}
}
if
setting
.
ImageUploadProvider
!=
""
{
if
setting
.
ImageUploadProvider
!=
""
{
log
.
Error2
(
"The external image storage configuration is invalid"
,
"unsupported provider"
,
setting
.
ImageUploadProvider
)
log
ger
.
Error
(
"The external image storage configuration is invalid"
,
"unsupported provider"
,
setting
.
ImageUploadProvider
)
}
}
return
NopImageUploader
{},
nil
return
NopImageUploader
{},
nil
...
...
pkg/log/log.go
View file @
f9560f94
...
@@ -10,13 +10,11 @@ import (
...
@@ -10,13 +10,11 @@ import (
"path/filepath"
"path/filepath"
"strings"
"strings"
"gopkg.in/ini.v1"
"github.com/go-stack/stack"
"github.com/go-stack/stack"
"github.com/grafana/grafana/pkg/util"
"github.com/inconshreveable/log15"
"github.com/inconshreveable/log15"
isatty
"github.com/mattn/go-isatty"
isatty
"github.com/mattn/go-isatty"
"gopkg.in/ini.v1"
"github.com/grafana/grafana/pkg/util"
)
)
var
Root
log15
.
Logger
var
Root
log15
.
Logger
...
@@ -58,10 +56,6 @@ func Debug(format string, v ...interface{}) {
...
@@ -58,10 +56,6 @@ func Debug(format string, v ...interface{}) {
Root
.
Debug
(
message
)
Root
.
Debug
(
message
)
}
}
func
Debug2
(
message
string
,
v
...
interface
{})
{
Root
.
Debug
(
message
,
v
...
)
}
func
Info
(
format
string
,
v
...
interface
{})
{
func
Info
(
format
string
,
v
...
interface
{})
{
var
message
string
var
message
string
if
len
(
v
)
>
0
{
if
len
(
v
)
>
0
{
...
@@ -73,10 +67,6 @@ func Info(format string, v ...interface{}) {
...
@@ -73,10 +67,6 @@ func Info(format string, v ...interface{}) {
Root
.
Info
(
message
)
Root
.
Info
(
message
)
}
}
func
Info2
(
message
string
,
v
...
interface
{})
{
Root
.
Info
(
message
,
v
...
)
}
func
Warn
(
format
string
,
v
...
interface
{})
{
func
Warn
(
format
string
,
v
...
interface
{})
{
var
message
string
var
message
string
if
len
(
v
)
>
0
{
if
len
(
v
)
>
0
{
...
@@ -88,18 +78,10 @@ func Warn(format string, v ...interface{}) {
...
@@ -88,18 +78,10 @@ func Warn(format string, v ...interface{}) {
Root
.
Warn
(
message
)
Root
.
Warn
(
message
)
}
}
func
Warn2
(
message
string
,
v
...
interface
{})
{
Root
.
Warn
(
message
,
v
...
)
}
func
Error
(
skip
int
,
format
string
,
v
...
interface
{})
{
func
Error
(
skip
int
,
format
string
,
v
...
interface
{})
{
Root
.
Error
(
fmt
.
Sprintf
(
format
,
v
...
))
Root
.
Error
(
fmt
.
Sprintf
(
format
,
v
...
))
}
}
func
Error2
(
message
string
,
v
...
interface
{})
{
Root
.
Error
(
message
,
v
...
)
}
func
Critical
(
skip
int
,
format
string
,
v
...
interface
{})
{
func
Critical
(
skip
int
,
format
string
,
v
...
interface
{})
{
Root
.
Crit
(
fmt
.
Sprintf
(
format
,
v
...
))
Root
.
Crit
(
fmt
.
Sprintf
(
format
,
v
...
))
}
}
...
...
pkg/login/ext_user.go
View file @
f9560f94
...
@@ -11,6 +11,10 @@ func init() {
...
@@ -11,6 +11,10 @@ func init() {
bus
.
AddHandler
(
"auth"
,
UpsertUser
)
bus
.
AddHandler
(
"auth"
,
UpsertUser
)
}
}
var
(
logger
=
log
.
New
(
"login.ext_user"
)
)
func
UpsertUser
(
cmd
*
m
.
UpsertUserCommand
)
error
{
func
UpsertUser
(
cmd
*
m
.
UpsertUserCommand
)
error
{
extUser
:=
cmd
.
ExternalUser
extUser
:=
cmd
.
ExternalUser
...
@@ -135,7 +139,7 @@ func updateUser(user *m.User, extUser *m.ExternalUserInfo) error {
...
@@ -135,7 +139,7 @@ func updateUser(user *m.User, extUser *m.ExternalUserInfo) error {
return
nil
return
nil
}
}
log
.
Debug2
(
"Syncing user info"
,
"id"
,
user
.
Id
,
"update"
,
updateCmd
)
log
ger
.
Debug
(
"Syncing user info"
,
"id"
,
user
.
Id
,
"update"
,
updateCmd
)
return
bus
.
Dispatch
(
updateCmd
)
return
bus
.
Dispatch
(
updateCmd
)
}
}
...
...
pkg/services/alerting/notifiers/telegram.go
View file @
f9560f94
...
@@ -130,7 +130,7 @@ func (this *TelegramNotifier) buildMessageInlineImage(evalContext *alerting.Eval
...
@@ -130,7 +130,7 @@ func (this *TelegramNotifier) buildMessageInlineImage(evalContext *alerting.Eval
defer
func
()
{
defer
func
()
{
err
:=
imageFile
.
Close
()
err
:=
imageFile
.
Close
()
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Error2
(
"Could not close Telegram inline image."
,
"err"
,
err
)
this
.
log
.
Error
(
"Could not close Telegram inline image."
,
"err"
,
err
)
}
}
}()
}()
...
...
pkg/services/alerting/test_notification.go
View file @
f9560f94
...
@@ -18,9 +18,12 @@ type NotificationTestCommand struct {
...
@@ -18,9 +18,12 @@ type NotificationTestCommand struct {
Settings
*
simplejson
.
Json
Settings
*
simplejson
.
Json
}
}
var
(
logger
=
log
.
New
(
"alerting.testnotification"
)
)
func
init
()
{
func
init
()
{
bus
.
AddHandler
(
"alerting"
,
handleNotificationTestCommand
)
bus
.
AddHandler
(
"alerting"
,
handleNotificationTestCommand
)
}
}
func
handleNotificationTestCommand
(
cmd
*
NotificationTestCommand
)
error
{
func
handleNotificationTestCommand
(
cmd
*
NotificationTestCommand
)
error
{
...
@@ -35,7 +38,7 @@ func handleNotificationTestCommand(cmd *NotificationTestCommand) error {
...
@@ -35,7 +38,7 @@ func handleNotificationTestCommand(cmd *NotificationTestCommand) error {
notifiers
,
err
:=
InitNotifier
(
model
)
notifiers
,
err
:=
InitNotifier
(
model
)
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Error2
(
"Failed to create notifier"
,
"error"
,
err
.
Error
())
log
ger
.
Error
(
"Failed to create notifier"
,
"error"
,
err
.
Error
())
return
err
return
err
}
}
...
...
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