summaryrefslogtreecommitdiff
path: root/internal/variable.h
diff options
context:
space:
mode:
authorKoichi Sasada <ko1@atdot.net>2020-07-03 16:55:54 +0900
committerGitHub <noreply@github.com>2020-07-03 16:55:54 +0900
commit8655c2e69041cc812d30c2e951a8ac9ea7a60c47 (patch)
tree2e2c7dc0fd0cac81c2827dd0ffc2094c31c5bd3d /internal/variable.h
parent01776ca1c0eb368dd820a3259288466076d9cd46 (diff)
downloadruby-8655c2e69041cc812d30c2e951a8ac9ea7a60c47.tar.gz
RUBY_DEBUG_LOG: Logging debug information mechanism (#3279)
* RUBY_DEBUG_LOG: Logging debug information mechanism This feature provides a mechanism to store logging information to a file, stderr or memory space with simple macros. The following information will be stored. * (1) __FILE__, __LINE__ in C * (2) __FILE__, __LINE__ in Ruby * (3) __func__ in C (message title) * (4) given string with sprintf format * (5) Thread number (if multiple threads are running) This feature is enabled only USE_RUBY_DEBUG_LOG is enabled. Release version should not enable it. Running with the `RUBY_DEBUG_LOG` environment variable enables this feature. # logging into a file RUBY_DEBUG_LOG=/path/to/file STDERR # logging into STDERR RUBY_DEBUG_LOG=stderr # logging into memory space (check with a debugger) # It will help if the timing is important. RUBY_DEBUG_LOG=mem RUBY_DEBUG_LOG_FILTER environment variable can specify the fileter string. If "(3) __func__ in C (message title)" contains the specified string, the infomation will be stored (example: RUBY_DEBUG_LOG_FILTER=str will enable only on str related information). In a MRI source code, you can use the following macros: * RUBY_DEBUG_LOG(fmt, ...): Above (1) to (4) will be logged. * RUBY_DEBUG_LOG2(file, line, fmt, ...): Same as RUBY_DEBUG_LOG(), but (1) will be replaced with given file, line.
Diffstat (limited to 'internal/variable.h')
0 files changed, 0 insertions, 0 deletions