Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gostnops
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wei.xuan
gostnops
Commits
e7592d92
Unverified
Commit
e7592d92
authored
May 30, 2021
by
Gnps,Gwps
Committed by
GitHub
May 30, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use Fprintf, not Fprint (#56)
* use Fprintf, not Fprint * fix log print error
parent
2acb24b0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
color.go
log/color.go
+4
-3
No files found.
log/color.go
View file @
e7592d92
...
...
@@ -68,17 +68,18 @@ func funcFileLine() string {
}
func
CPrintf
(
color
[]
byte
,
format
string
,
args
...
interface
{})
{
logStr
:=
fmt
.
Sprintf
(
format
,
args
...
)
if
isatty
.
IsTerminal
(
os
.
Stdout
.
Fd
())
{
fmt
.
Fprint
(
os
.
Stdout
,
string
(
color
)
+
funcFileLine
()
+
fmt
.
Sprintf
(
format
,
args
...
)
+
string
(
reset
)
)
fmt
.
Fprint
f
(
os
.
Stdout
,
string
(
color
)
+
funcFileLine
()
+
"%s"
+
string
(
reset
),
logStr
)
}
else
{
fmt
.
Fprint
(
os
.
Stdout
,
fmt
.
Sprintf
(
format
,
args
...
)
)
fmt
.
Fprint
f
(
os
.
Stdout
,
"%s"
,
logStr
)
}
}
func
CPrintfln
(
color
[]
byte
,
format
string
,
args
...
interface
{})
{
logStr
:=
fmt
.
Sprintf
(
format
,
args
...
)
if
isatty
.
IsTerminal
(
os
.
Stdout
.
Fd
())
{
fmt
.
Fprint
(
os
.
Stdout
,
string
(
color
)
+
funcFileLine
()
+
"%s"
+
string
(
reset
)
+
"
\n
"
,
logStr
)
fmt
.
Fprint
f
(
os
.
Stdout
,
string
(
color
)
+
funcFileLine
()
+
"%s"
+
string
(
reset
)
+
"
\n
"
,
logStr
)
}
else
{
fmt
.
Fprintf
(
os
.
Stdout
,
"%s
\n
"
,
logStr
)
}
...
...
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