summaryrefslogtreecommitdiff
path: root/src/mongo/logv2
diff options
context:
space:
mode:
authorGabriel Russell <gabriel.russell@mongodb.com>2020-06-05 15:51:51 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-06-10 22:15:48 +0000
commit6f78f6559b8aadb6ec1865fabfb93d7b2736ae92 (patch)
tree6e9ce4f6961a1e235f1eb3b18083ff18f0cdb2b5 /src/mongo/logv2
parent16008228ec1ce35dc7979c4ccc0af6dc9b375988 (diff)
downloadmongo-6f78f6559b8aadb6ec1865fabfb93d7b2736ae92.tar.gz
SERVER-48352 logv2 cleanup for scripting/mozjs, shell/
o also, deduplicated the example log id's in src/mongo/logv2/README.md even though they were just examples, it was funny that there werre not unique
Diffstat (limited to 'src/mongo/logv2')
-rw-r--r--src/mongo/logv2/README.md20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/mongo/logv2/README.md b/src/mongo/logv2/README.md
index 6de91a458e8..427526f131d 100644
--- a/src/mongo/logv2/README.md
+++ b/src/mongo/logv2/README.md
@@ -223,7 +223,7 @@ if (condition) {
// Be careful of functions returning by value
attrs.add("extra", getExtraInfo());
}
-LOGV2(1030, "dynamic attributes", attrs);
+LOGV2(1030, "Dynamic attributes", attrs);
```
# Type Support
@@ -332,15 +332,15 @@ mapLog indicates that it is a range coming from an associative container where t
```
std::array<int, 20> arrayOfInts = ...;
-LOGV2(1010, "log container directly: {values}", "values"_attr = arrayOfInts);
-LOGV2(1011, "log iterator range: {values}", "values"_attr = seqLog(arrayOfInts.begin(), arrayOfInts.end());
-LOGV2(1012, "log first five elements: {values}", "values"_attr = seqLog(arrayOfInts.data(), arrayOfInts.data() + 5);
+LOGV2(1010, "Log container directly: {values}", "values"_attr = arrayOfInts);
+LOGV2(1011, "Log iterator range: {values}", "values"_attr = seqLog(arrayOfInts.begin(), arrayOfInts.end());
+LOGV2(1012, "Log first five elements: {values}", "values"_attr = seqLog(arrayOfInts.data(), arrayOfInts.data() + 5);
```
```
StringMap<BSONObj> bsonMap = ...;
-LOGV2(1013, "log map directly: {values}", "values"_attr = bsonMap);
-LOGV2(1014, "log map iterator range: {values}", "values"_attr = mapLog(bsonMap.begin(), bsonMap.end());
+LOGV2(1013, "Log map directly: {values}", "values"_attr = bsonMap);
+LOGV2(1014, "Log map iterator range: {values}", "values"_attr = mapLog(bsonMap.begin(), bsonMap.end());
```
#### Containers and uint64_t
@@ -354,7 +354,7 @@ std::vector<uint64_t> vec = ...;
// If we know casting to signed is safe
auto asSigned = [](uint64_t i) { return static_cast<int64_t>(i); };
-LOGV2(2000, "as signed array: {values}", "values"_attr = seqLog(
+LOGV2(2000, "As signed array: {values}", "values"_attr = seqLog(
boost::make_transform_iterator(vec.begin(), asSigned),
boost::make_transform_iterator(vec.end(), asSigned)
));
@@ -411,7 +411,7 @@ public:
##### Examples
```
const AnyUserType& t = ...;
-LOGV2(2000, "log of user type", logAttr(t));
+LOGV2(2001, "Log of user type", logAttr(t));
```
## Multiple attributes
@@ -436,9 +436,9 @@ NotALoggableType t = ...;
// These two log statements would produce the same output (apart from different id)
-LOGV2(2001, "Log of non-loggable type's members", logAttrs(t));
+LOGV2(2002, "Log of non-loggable type's members", logAttrs(t));
-LOGV2(2001, "Log of non-loggable type's members", "name"_attr=t.name, "data"_attr=t.data);
+LOGV2(2003, "Log of non-loggable type's members", "name"_attr=t.name, "data"_attr=t.data);
```