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
1b6203e4
Commit
1b6203e4
authored
Jan 15, 2019
by
bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removes error2 logger
parent
1c0a385d
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
17 deletions
+13
-17
pkg/components/imguploader/imguploader.go
+5
-2
pkg/log/log.go
+2
-12
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 @
1b6203e4
...
...
@@ -6,7 +6,6 @@ import (
"regexp"
"github.com/grafana/grafana/pkg/log"
"github.com/grafana/grafana/pkg/setting"
)
...
...
@@ -21,6 +20,10 @@ func (NopImageUploader) Upload(ctx context.Context, path string) (string, error)
return
""
,
nil
}
var
(
logger
=
log
.
New
(
"imguploader"
)
)
func
NewImageUploader
()
(
ImageUploader
,
error
)
{
switch
setting
.
ImageUploadProvider
{
...
...
@@ -94,7 +97,7 @@ func NewImageUploader() (ImageUploader, error) {
}
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
...
...
pkg/log/log.go
View file @
1b6203e4
...
...
@@ -10,13 +10,11 @@ import (
"path/filepath"
"strings"
"gopkg.in/ini.v1"
"github.com/go-stack/stack"
"github.com/grafana/grafana/pkg/util"
"github.com/inconshreveable/log15"
isatty
"github.com/mattn/go-isatty"
"github.com/grafana/grafana/pkg/util"
"gopkg.in/ini.v1"
)
var
Root
log15
.
Logger
...
...
@@ -88,18 +86,10 @@ func Warn(format string, v ...interface{}) {
Root
.
Warn
(
message
)
}
func
Warn2
(
message
string
,
v
...
interface
{})
{
Root
.
Warn
(
message
,
v
...
)
}
func
Error
(
skip
int
,
format
string
,
v
...
interface
{})
{
Root
.
Error
(
fmt
.
Sprintf
(
format
,
v
...
))
}
func
Error2
(
message
string
,
v
...
interface
{})
{
Root
.
Error
(
message
,
v
...
)
}
func
Critical
(
skip
int
,
format
string
,
v
...
interface
{})
{
Root
.
Crit
(
fmt
.
Sprintf
(
format
,
v
...
))
}
...
...
pkg/services/alerting/notifiers/telegram.go
View file @
1b6203e4
...
...
@@ -130,7 +130,7 @@ func (this *TelegramNotifier) buildMessageInlineImage(evalContext *alerting.Eval
defer
func
()
{
err
:=
imageFile
.
Close
()
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 @
1b6203e4
...
...
@@ -18,9 +18,12 @@ type NotificationTestCommand struct {
Settings
*
simplejson
.
Json
}
var
(
logger
=
log
.
New
(
"alerting.testnotification"
)
)
func
init
()
{
bus
.
AddHandler
(
"alerting"
,
handleNotificationTestCommand
)
}
func
handleNotificationTestCommand
(
cmd
*
NotificationTestCommand
)
error
{
...
...
@@ -35,7 +38,7 @@ func handleNotificationTestCommand(cmd *NotificationTestCommand) error {
notifiers
,
err
:=
InitNotifier
(
model
)
if
err
!=
nil
{
log
.
Error2
(
"Failed to create notifier"
,
"error"
,
err
.
Error
())
log
ger
.
Error
(
"Failed to create notifier"
,
"error"
,
err
.
Error
())
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