Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
Loki
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Loki
Commits
a07b5ccb
Unverified
Commit
a07b5ccb
authored
6 years ago
by
David
Committed by
GitHub
6 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #459 from daixiang0/print-error-to-stderr
Log error to stderr
parents
894357bc
72b99243
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cmd/logcli/client.go
+2
-1
2 additions, 1 deletion
cmd/logcli/client.go
cmd/logcli/main.go
+4
-3
4 additions, 3 deletions
cmd/logcli/main.go
with
6 additions
and
4 deletions
cmd/logcli/client.go
+
2
−
1
View file @
a07b5ccb
...
...
@@ -4,6 +4,7 @@ import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
"net/url"
"time"
...
...
@@ -48,7 +49,7 @@ func listLabelValues(name string) (*logproto.LabelResponse, error) {
func
doRequest
(
path
string
,
out
interface
{})
error
{
url
:=
*
addr
+
path
fmt
.
Print
ln
(
url
)
log
.
Print
(
url
)
req
,
err
:=
http
.
NewRequest
(
"GET"
,
url
,
nil
)
if
err
!=
nil
{
...
...
This diff is collapsed.
Click to expand it.
cmd/logcli/main.go
+
4
−
3
View file @
a07b5ccb
package
main
import
(
"
fmt
"
"
log
"
"os"
kingpin
"gopkg.in/alecthomas/kingpin.v2"
...
...
@@ -28,11 +28,12 @@ var (
)
func
main
()
{
log
.
SetOutput
(
os
.
Stderr
)
switch
kingpin
.
MustParse
(
app
.
Parse
(
os
.
Args
[
1
:
]))
{
case
queryCmd
.
FullCommand
()
:
if
*
addr
==
""
{
fmt
.
Println
(
"Server address cannot be empty"
)
os
.
Exit
(
1
)
log
.
Fatalln
(
"Server address cannot be empty"
)
}
doQuery
()
case
labelsCmd
.
FullCommand
()
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment