diff options
author | Henrik Edin <henrik.edin@mongodb.com> | 2020-04-22 13:20:51 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-04-24 12:40:38 +0000 |
commit | 60ed56e7246f862c5874f6c346d1b1ec6bc948a8 (patch) | |
tree | a1fa677ab3d4a2c1e1efa0b6cda9d67484d2e27c /buildscripts/linter | |
parent | 381dbd91f3c5c0e7b23513c6b93fc4842ad96b26 (diff) | |
download | mongo-60ed56e7246f862c5874f6c346d1b1ec6bc948a8.tar.gz |
SERVER-47332 Add way to do unstructured logging for local development
Diffstat (limited to 'buildscripts/linter')
-rw-r--r-- | buildscripts/linter/simplecpplint.py | 9 |
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 |