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
1771ab03
Commit
1771ab03
authored
Jun 17, 2016
by
bergquist
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into alerting
parents
8ec311ad
8b2f6fff
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
24 deletions
+31
-24
appveyor.yml
+1
-1
pkg/log/log.go
+1
-11
pkg/log/syslog.go
+17
-2
pkg/log/syslog_windows.go
+7
-5
pkg/plugins/dashboards_test.go
+5
-5
No files found.
appveyor.yml
View file @
1771ab03
...
@@ -14,7 +14,7 @@ install:
...
@@ -14,7 +14,7 @@ install:
-
npm install
-
npm install
-
npm install -g grunt-cli
-
npm install -g grunt-cli
# install gcc (needed for sqlite3)
# install gcc (needed for sqlite3)
-
choco install -y
mingw -limitoutput
-
choco install -y
--limit-output mingw
-
set PATH=C:\tools\mingw64\bin;%PATH%
-
set PATH=C:\tools\mingw64\bin;%PATH%
-
echo %PATH%
-
echo %PATH%
-
echo %GOPATH%
-
echo %GOPATH%
...
...
pkg/log/log.go
View file @
1771ab03
...
@@ -180,17 +180,7 @@ func ReadLoggingConfig(modes []string, logsPath string, cfg *ini.File) {
...
@@ -180,17 +180,7 @@ func ReadLoggingConfig(modes []string, logsPath string, cfg *ini.File) {
loggersToClose
=
append
(
loggersToClose
,
fileHandler
)
loggersToClose
=
append
(
loggersToClose
,
fileHandler
)
handler
=
fileHandler
handler
=
fileHandler
case
"syslog"
:
case
"syslog"
:
sysLogHandler
:=
NewSyslog
()
sysLogHandler
:=
NewSyslog
(
sec
,
format
)
sysLogHandler
.
Format
=
format
sysLogHandler
.
Network
=
sec
.
Key
(
"network"
)
.
MustString
(
""
)
sysLogHandler
.
Address
=
sec
.
Key
(
"address"
)
.
MustString
(
""
)
sysLogHandler
.
Facility
=
sec
.
Key
(
"facility"
)
.
MustString
(
"local7"
)
sysLogHandler
.
Tag
=
sec
.
Key
(
"tag"
)
.
MustString
(
""
)
if
err
:=
sysLogHandler
.
Init
();
err
!=
nil
{
Root
.
Error
(
"Failed to init syslog log handler"
,
"error"
,
err
)
os
.
Exit
(
1
)
}
loggersToClose
=
append
(
loggersToClose
,
sysLogHandler
)
loggersToClose
=
append
(
loggersToClose
,
sysLogHandler
)
handler
=
sysLogHandler
handler
=
sysLogHandler
...
...
pkg/log/syslog.go
View file @
1771ab03
...
@@ -5,8 +5,10 @@ package log
...
@@ -5,8 +5,10 @@ package log
import
(
import
(
"errors"
"errors"
"log/syslog"
"log/syslog"
"os"
"github.com/inconshreveable/log15"
"github.com/inconshreveable/log15"
"gopkg.in/ini.v1"
)
)
type
SysLogHandler
struct
{
type
SysLogHandler
struct
{
...
@@ -18,10 +20,23 @@ type SysLogHandler struct {
...
@@ -18,10 +20,23 @@ type SysLogHandler struct {
Format
log15
.
Format
Format
log15
.
Format
}
}
func
NewSyslog
()
*
SysLogHandler
{
func
NewSyslog
(
sec
*
ini
.
Section
,
format
log15
.
Format
)
*
SysLogHandler
{
return
&
SysLogHandler
{
handler
:=
&
SysLogHandler
{
Format
:
log15
.
LogfmtFormat
(),
Format
:
log15
.
LogfmtFormat
(),
}
}
handler
.
Format
=
format
handler
.
Network
=
sec
.
Key
(
"network"
)
.
MustString
(
""
)
handler
.
Address
=
sec
.
Key
(
"address"
)
.
MustString
(
""
)
handler
.
Facility
=
sec
.
Key
(
"facility"
)
.
MustString
(
"local7"
)
handler
.
Tag
=
sec
.
Key
(
"tag"
)
.
MustString
(
""
)
if
err
:=
handler
.
Init
();
err
!=
nil
{
Root
.
Error
(
"Failed to init syslog log handler"
,
"error"
,
err
)
os
.
Exit
(
1
)
}
return
handler
}
}
func
(
sw
*
SysLogHandler
)
Init
()
error
{
func
(
sw
*
SysLogHandler
)
Init
()
error
{
...
...
pkg/log/syslog_windows.go
View file @
1771ab03
...
@@ -2,19 +2,21 @@
...
@@ -2,19 +2,21 @@
package
log
package
log
import
"github.com/inconshreveable/log15"
import
(
"github.com/inconshreveable/log15"
"gopkg.in/ini.v1"
)
type
SysLogHandler
struct
{
type
SysLogHandler
struct
{
}
}
func
NewSyslog
()
*
SysLogHandler
{
func
NewSyslog
(
sec
*
ini
.
Section
,
format
log15
.
Format
)
*
SysLogHandler
{
return
&
SysLogHandler
{}
return
&
SysLogHandler
{}
}
}
func
(
sw
*
SysLogHandler
)
Init
(
)
error
{
func
(
sw
*
SysLogHandler
)
Log
(
r
*
log15
.
Record
)
error
{
return
nil
return
nil
}
}
func
(
sw
*
SysLogHandler
)
Log
(
r
*
log15
.
Record
)
error
{
func
(
sw
*
SysLogHandler
)
Close
()
{
return
nil
}
}
pkg/plugins/dashboards_test.go
View file @
1771ab03
...
@@ -41,12 +41,12 @@ func TestPluginDashboards(t *testing.T) {
...
@@ -41,12 +41,12 @@ func TestPluginDashboards(t *testing.T) {
Convey
(
"should include installed version info"
,
func
()
{
Convey
(
"should include installed version info"
,
func
()
{
So
(
dashboards
[
0
]
.
Title
,
ShouldEqual
,
"Nginx Connections"
)
So
(
dashboards
[
0
]
.
Title
,
ShouldEqual
,
"Nginx Connections"
)
So
(
dashboards
[
0
]
.
Revision
,
ShouldEqual
,
"1.5"
)
//
So(dashboards[0].Revision, ShouldEqual, "1.5")
So
(
dashboards
[
0
]
.
InstalledRevision
,
ShouldEqual
,
"1.1"
)
//
So(dashboards[0].InstalledRevision, ShouldEqual, "1.1")
So
(
dashboards
[
0
]
.
InstalledUri
,
ShouldEqual
,
"db/nginx-connections"
)
//
So(dashboards[0].InstalledUri, ShouldEqual, "db/nginx-connections")
So
(
dashboards
[
1
]
.
Revision
,
ShouldEqual
,
"2.0"
)
//
So(dashboards[1].Revision, ShouldEqual, "2.0")
So
(
dashboards
[
1
]
.
InstalledRevision
,
ShouldEqual
,
""
)
//
So(dashboards[1].InstalledRevision, ShouldEqual, "")
})
})
})
})
...
...
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