good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
bor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open
bor
Commits
bdf99e09
Commit
bdf99e09
authored
Jan 21, 2015
by
Taylor Gerring
Browse files
Options
Downloads
Patches
Plain Diff
Add LogFormat flag
parent
acdc19d1
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
cmd/ethereum/flags.go
+2
-0
2 additions, 0 deletions
cmd/ethereum/flags.go
cmd/ethereum/main.go
+1
-0
1 addition, 0 deletions
cmd/ethereum/main.go
eth/backend.go
+2
-1
2 additions, 1 deletion
eth/backend.go
logger/log.go
+8
-2
8 additions, 2 deletions
logger/log.go
with
13 additions
and
3 deletions
cmd/ethereum/flags.go
+
2
−
0
View file @
bdf99e09
...
@@ -57,6 +57,7 @@ var (
...
@@ -57,6 +57,7 @@ var (
ConfigFile
string
ConfigFile
string
DebugFile
string
DebugFile
string
LogLevel
int
LogLevel
int
LogFormat
string
Dump
bool
Dump
bool
DumpHash
string
DumpHash
string
DumpNumber
int
DumpNumber
int
...
@@ -110,6 +111,7 @@ func Init() {
...
@@ -110,6 +111,7 @@ func Init() {
flag
.
StringVar
(
&
ConfigFile
,
"conf"
,
defaultConfigFile
,
"config file"
)
flag
.
StringVar
(
&
ConfigFile
,
"conf"
,
defaultConfigFile
,
"config file"
)
flag
.
StringVar
(
&
DebugFile
,
"debug"
,
""
,
"debug file (no debugging if not set)"
)
flag
.
StringVar
(
&
DebugFile
,
"debug"
,
""
,
"debug file (no debugging if not set)"
)
flag
.
IntVar
(
&
LogLevel
,
"loglevel"
,
int
(
logger
.
InfoLevel
),
"loglevel: 0-5: silent,error,warn,info,debug,debug detail)"
)
flag
.
IntVar
(
&
LogLevel
,
"loglevel"
,
int
(
logger
.
InfoLevel
),
"loglevel: 0-5: silent,error,warn,info,debug,debug detail)"
)
flag
.
StringVar
(
&
LogFormat
,
"logformat"
,
"std"
,
"logformat: std,raw)"
)
flag
.
BoolVar
(
&
DiffTool
,
"difftool"
,
false
,
"creates output for diff'ing. Sets LogLevel=0"
)
flag
.
BoolVar
(
&
DiffTool
,
"difftool"
,
false
,
"creates output for diff'ing. Sets LogLevel=0"
)
flag
.
StringVar
(
&
DiffType
,
"diff"
,
"all"
,
"sets the level of diff output [vm, all]. Has no effect if difftool=false"
)
flag
.
StringVar
(
&
DiffType
,
"diff"
,
"all"
,
"sets the level of diff output [vm, all]. Has no effect if difftool=false"
)
flag
.
BoolVar
(
&
ShowGenesis
,
"genesis"
,
false
,
"Dump the genesis block"
)
flag
.
BoolVar
(
&
ShowGenesis
,
"genesis"
,
false
,
"Dump the genesis block"
)
...
...
This diff is collapsed.
Click to expand it.
cmd/ethereum/main.go
+
1
−
0
View file @
bdf99e09
...
@@ -67,6 +67,7 @@ func main() {
...
@@ -67,6 +67,7 @@ func main() {
DataDir
:
Datadir
,
DataDir
:
Datadir
,
LogFile
:
LogFile
,
LogFile
:
LogFile
,
LogLevel
:
LogLevel
,
LogLevel
:
LogLevel
,
LogFormat
:
LogFormat
,
Identifier
:
Identifier
,
Identifier
:
Identifier
,
MaxPeers
:
MaxPeer
,
MaxPeers
:
MaxPeer
,
Port
:
OutboundPort
,
Port
:
OutboundPort
,
...
...
This diff is collapsed.
Click to expand it.
eth/backend.go
+
2
−
1
View file @
bdf99e09
...
@@ -29,6 +29,7 @@ type Config struct {
...
@@ -29,6 +29,7 @@ type Config struct {
DataDir
string
DataDir
string
LogFile
string
LogFile
string
LogLevel
int
LogLevel
int
LogFormat
string
KeyRing
string
KeyRing
string
MaxPeers
int
MaxPeers
int
...
@@ -80,7 +81,7 @@ type Ethereum struct {
...
@@ -80,7 +81,7 @@ type Ethereum struct {
func
New
(
config
*
Config
)
(
*
Ethereum
,
error
)
{
func
New
(
config
*
Config
)
(
*
Ethereum
,
error
)
{
// Boostrap database
// Boostrap database
logger
:=
ethlogger
.
New
(
config
.
DataDir
,
config
.
LogFile
,
config
.
LogLevel
)
logger
:=
ethlogger
.
New
(
config
.
DataDir
,
config
.
LogFile
,
config
.
LogLevel
,
config
.
LogFormat
)
db
,
err
:=
ethdb
.
NewLDBDatabase
(
"blockchain"
)
db
,
err
:=
ethdb
.
NewLDBDatabase
(
"blockchain"
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
...
...
This diff is collapsed.
Click to expand it.
logger/log.go
+
8
−
2
View file @
bdf99e09
...
@@ -18,7 +18,7 @@ func openLogFile(datadir string, filename string) *os.File {
...
@@ -18,7 +18,7 @@ func openLogFile(datadir string, filename string) *os.File {
return
file
return
file
}
}
func
New
(
datadir
string
,
logFile
string
,
logLevel
int
)
LogSystem
{
func
New
(
datadir
string
,
logFile
string
,
logLevel
int
,
logFormat
string
)
LogSystem
{
var
writer
io
.
Writer
var
writer
io
.
Writer
if
logFile
==
""
{
if
logFile
==
""
{
writer
=
os
.
Stdout
writer
=
os
.
Stdout
...
@@ -26,7 +26,13 @@ func New(datadir string, logFile string, logLevel int) LogSystem {
...
@@ -26,7 +26,13 @@ func New(datadir string, logFile string, logLevel int) LogSystem {
writer
=
openLogFile
(
datadir
,
logFile
)
writer
=
openLogFile
(
datadir
,
logFile
)
}
}
sys
:=
NewStdLogSystem
(
writer
,
log
.
LstdFlags
,
LogLevel
(
logLevel
))
var
sys
LogSystem
switch
logFormat
{
case
"raw"
:
sys
=
NewRawLogSystem
(
writer
,
0
,
LogLevel
(
logLevel
))
default
:
sys
=
NewStdLogSystem
(
writer
,
log
.
LstdFlags
,
LogLevel
(
logLevel
))
}
AddLogSystem
(
sys
)
AddLogSystem
(
sys
)
return
sys
return
sys
...
...
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