diff options
author | Anna Henningsen <anna@addaleax.net> | 2018-07-17 02:50:07 +0200 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2018-08-01 17:16:51 +0200 |
commit | 620e46c8b59b6269784ebba42b23f23897eeedb9 (patch) | |
tree | 6b396fdec4964d0305bbbb62195ebf56e636c78e /src/util.cc | |
parent | 3ac94dc977b232a4502307733af2b3af60e7b102 (diff) | |
download | android-node-v8-620e46c8b59b6269784ebba42b23f23897eeedb9.tar.gz android-node-v8-620e46c8b59b6269784ebba42b23f23897eeedb9.tar.bz2 android-node-v8-620e46c8b59b6269784ebba42b23f23897eeedb9.zip |
src: refactor default trace writer out of agent
The agent code is supposed to manage multiple writers/clients.
Adding the default writer into the mix breaks that encapsulation.
Instead, manage default options through a separate "virtual"
default client handle, and keep the file writer management
all to the actual users.
PR-URL: https://github.com/nodejs/node/pull/21867
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Diffstat (limited to 'src/util.cc')
-rw-r--r-- | src/util.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/util.cc b/src/util.cc index 3e808e13fe..66be18eae2 100644 --- a/src/util.cc +++ b/src/util.cc @@ -24,6 +24,7 @@ #include "node_internals.h" #include "uv.h" #include <stdio.h> +#include <sstream> namespace node { @@ -118,4 +119,17 @@ void GetHumanReadableProcessName(char (*name)[1024]) { snprintf(*name, sizeof(*name), "%s[%d]", title, uv_os_getpid()); } +std::set<std::string> ParseCommaSeparatedSet(const std::string& in) { + std::set<std::string> out; + if (in.empty()) + return out; + std::istringstream in_stream(in); + while (in_stream.good()) { + std::string item; + getline(in_stream, item, ','); + out.emplace(std::move(item)); + } + return out; +} + } // namespace node |