summaryrefslogtreecommitdiff
path: root/buildscripts/linter
diff options
context:
space:
mode:
Diffstat (limited to 'buildscripts/linter')
-rw-r--r--buildscripts/linter/simplecpplint.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/buildscripts/linter/simplecpplint.py b/buildscripts/linter/simplecpplint.py
index e1aef8e1e7c..cf4df8e4b47 100644
--- a/buildscripts/linter/simplecpplint.py
+++ b/buildscripts/linter/simplecpplint.py
@@ -56,6 +56,7 @@ _RE_PATTERN_MONGO_POLYFILL = _make_polyfill_regex()
_RE_VOLATILE = re.compile('[^_]volatile')
_RE_MUTEX = re.compile('[ ({,]stdx?::mutex[ ({]')
_RE_ASSERT = re.compile(r'\bassert\s*\(')
+_RE_UNSTRUCTURED_LOG = re.compile(r'\blogd\s*\(')
class Linter:
@@ -106,6 +107,7 @@ class Linter:
self._check_for_mongo_atomic(linenum)
self._check_for_mongo_mutex(linenum)
self._check_for_nonmongo_assert(linenum)
+ self._check_for_mongo_unstructured_log(linenum)
self._check_for_mongo_config_header(linenum)
return self._error_count
@@ -182,6 +184,13 @@ class Linter:
'Illegal use of the bare assert function, use a function from assert_utils.h instead.'
)
+ def _check_for_mongo_unstructured_log(self, linenum):
+ line = self.clean_lines[linenum]
+ if _RE_UNSTRUCTURED_LOG.search(line) or 'doUnstructuredLogImpl' in line:
+ self._error(
+ linenum, 'mongodb/unstructuredlog', 'Illegal use of unstructured logging, '
+ 'this is only for local development use and should not be committed.')
+
def _check_for_server_side_public_license(self, copyright_offset):
license_header = '''\
* This program is free software: you can redistribute it and/or modify