-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add log_level parameter to teraslice job. #3505
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix the default problem, and is there a way we could have implemented a test to catch that scenario.
37aa7e8
to
21b423e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bump sub package versions and teraslice version to 0.90.0
(both top level and subpackage) and consider the inline suggestion
if (typeof level !== 'string') { | ||
throw new Error('must be of type string'); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given the check against logLevels
I think this test for string might be redundant and less useful. Imaging a user provides a number 5
, then they will be told to use a string
. Then they put in the string noisy
, then it finally tells them the acceptible set of strings. Maybe the next check should test for string and includes(level).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I will combine the two checks and just have one error message.
There's not a whole lot of code here, but since it cross cuts packages and schemas and things we might ask for @jsnoble's input. |
27772eb
to
5b07d02
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Talked with @busma13 and asked to put in some comments and double check the log levels are changing when logs are sent to the file, also to put the type log_level
in the types package
I added an explanatory comment on each of the constructors that overwrites the log level. I also confirmed that the log_level indicated in the job is written to a log file (all log streams are overwritten with new log level). |
…execution controllers
Modify config-validators-spec to expect the correct error when testing log_level
1674bc7
to
ac537de
Compare
bump: (minor) @terascope/[email protected], [email protected] bump: (minor) [email protected], [email protected] bump: (minor) @terascope/[email protected], @terascope/[email protected] bump: (minor) @terascope/[email protected], [email protected] bump: (minor) [email protected], [email protected] bump: (minor) [email protected], @terascope/[email protected]
ac537de
to
245b7e7
Compare
This PR adds the
log_level
parameter to a teraslice job.loglevels
fromutils/src/Logger
log_level
tojob-components/src/job-schema
Worker
andExecutionController
constructors, use the log level from theexecutionContext
to set the log level ofcontext.logger
before it is used to create a new child logger.Worker
andExecutionController
instances.Ref: #3498