summaryrefslogtreecommitdiff
path: root/src/util-inl.h
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2018-05-27 16:37:30 +0200
committerAnna Henningsen <anna@addaleax.net>2018-05-31 09:54:48 +0200
commitbd85844c4e80c7aa1fc02a986c7619c3956b0061 (patch)
treed476c4d0b3469dfee41913b9a76ff39ab1deabfe /src/util-inl.h
parenteadcee11372d8228bcb203a9ab97a5f7d61d4809 (diff)
downloadnode-new-bd85844c4e80c7aa1fc02a986c7619c3956b0061.tar.gz
src: implement debug output utilities
Implement utilities for easier debugging of Node.js core code, inspired by the HTTP/2 debugging code. Debugging is, however, implemented at runtime rather than at compile time, controlled through a new `NODE_DEBUG_NATIVE=categories` environment variable. The runtime overhead in the debugging-disabled case amounts to 1 well-cachable one-byte read per debug call. PR-URL: https://github.com/nodejs/node/pull/20987 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Minwoo Jung <minwoo@nodesource.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/util-inl.h')
-rw-r--r--src/util-inl.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/util-inl.h b/src/util-inl.h
index ff0d47c078..90c7447f7e 100644
--- a/src/util-inl.h
+++ b/src/util-inl.h
@@ -293,6 +293,13 @@ char ToLower(char c) {
return c >= 'A' && c <= 'Z' ? c + ('a' - 'A') : c;
}
+std::string ToLower(const std::string& in) {
+ std::string out(in.size(), 0);
+ for (size_t i = 0; i < in.size(); ++i)
+ out[i] = ToLower(in[i]);
+ return out;
+}
+
bool StringEqualNoCase(const char* a, const char* b) {
do {
if (*a == '\0')