Logging
debug_backtraceAt
Sets the logging backtrace location. When a backtrace location is set and a log message is emitted at that location, the stack of the goroutine executing the log statement will be printed to stderr
.
Console
debug.backtraceAt(location)
RPC
{"method": "debug_backtraceAt", "params": [string]}
Parameters
location
string
The logging backtrace location specified as <filename>:<line>
.
Return Value
None
Example
HTTP RPC
debug_setVMLogTarget
Sets the output target of vmlog precompiled contract. When the output target is a file, logs from vmlog
calls in smart contracts will be written to DATADIR/log/vm.log
. Here DATADIR
is the directory specified by --datadir
when launching klay
. On the other hand, the output target is stdout
, logs will be displayed like a debug message on the standard output.
Console
debug.setVMLogTarget(target)
RPC
{"method": "debug_setVMLogTarget", "params": [number]}
Parameters
target
int
The output target (0: no output, 1: file, 2: stdout, 3: both) (default: 0)
Return Value
string
The output target. See the examples below for the actual return values.
Example
Console
HTTP RPC
debug_verbosity
Sets the logging verbosity ceiling. Log messages with level up to and including the given level will be printed.
(Level : 0=crit, 1=error, 2=warn, 3=info, 4=debug, 5=trace)
The verbosity of individual packages and source files can be raised using debug_vmodule
.
Console
debug.verbosity(level)
RPC
{"method": "debug_vmodule", "params": [number]}
Parameters
level
int
The logging verbosity level.
Return Value
None
Example
Console
HTTP RPC
debug_verbosityByName
Sets the verbosity of log module with given name. Please note that VerbosityByName only works with zapLogger.
(Level : 0=crit, 1=error, 2=warn, 3=info, 4=debug, 5=trace)
The verbosity of individual packages and source files can be raised using debug_vmodule
.
Console
debug.verbosityByName(name, level)
RPC
{"method": "debug_verbosityByName", "params": [string, number]}
Parameters
name
string
The module name.
level
int
The logging verbosity level.
Return Value
None
Example
Console
HTTP RPC
debug_verbosityByID
Sets the verbosity of log module with given ModuleID. Please note that VerbosityByID only works with zapLogger.
(ModuleID : Please refer to the code on the github. )
(Level : 0=crit, 1=error, 2=warn, 3=info, 4=debug, 5=trace)
The verbosity of individual packages and source files can be raised using debug_vmodule
.
Console
debug.verbosityByID(id, level)
RPC
{"method": "debug_verbosityByID", "params": [number, number]}
Parameters
id
int
The module id.
level
int
The logging verbosity level.
Return Value
None
Example
Console
HTTP RPC
debug_vmodule
Sets the logging verbosity pattern.
Console
debug.vmodule(module)
RPC
{"method": "debug_vmodule", "params": [string]}
Parameters
module
string
The module name for logging.
Return Value
None
Example
Console
If you want to see messages from a particular Go package (directory) and all subdirectories, use
If you want to restrict messages to a particular package (e.g., p2p) but exclude subdirectories, use
If you want to see log messages from a particular source file, use
HTTP RPC
Last updated