-
Notifications
You must be signed in to change notification settings - Fork 1
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
NH-68264 Upgrade c-lib 14 #259
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
19a5e7b
Bump c-lib 14, add log_type to ApmConfig and Reporter init
tammy-baylis-swi b80666f
Rm conditional oboeapi imports
tammy-baylis-swi 8c00850
Merge branch 'NH-68264-single-oboeapi-init' into NH-68264-upgrade-cli…
tammy-baylis-swi 98b9ad6
Update error msg
tammy-baylis-swi 6a11071
ApmConfig inits OboeAPIOptions, Configurator passes to API init
tammy-baylis-swi 28f5559
ApmConfig inits OboeAPI
tammy-baylis-swi fa40d50
Add ApmLoggingType and config assignment/check
tammy-baylis-swi a0db4a7
Add _update_log_settings and deprecate debug_level -1
tammy-baylis-swi 8408e31
Existing config tests include log_type kv
tammy-baylis-swi b09b623
Add test default_log_type
tammy-baylis-swi 8f2af9d
Add test__update_log_settings
tammy-baylis-swi f8b48e2
Add test__init_oboe_api
tammy-baylis-swi d5b417a
Update apm_logging tests
tammy-baylis-swi f126dc8
Keep debug_level -1, don't config log_type, change update_log_settings
tammy-baylis-swi b5e3f4b
Rm unused test import
tammy-baylis-swi 62624db
is_valid_log_type except ret default
tammy-baylis-swi 36e7ce2
Rm unused critical_level method
tammy-baylis-swi c854d2b
Rm unused fixture cnf log_type
tammy-baylis-swi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,10 +38,45 @@ | |
import os | ||
|
||
|
||
class ApmLoggingType: | ||
"""Mapping of supported solarwinds_apm library log types""" | ||
|
||
log_types = { | ||
"STDERR": 0, | ||
"FILE": 2, | ||
"DISABLED": 4, | ||
} | ||
Comment on lines
+44
to
+48
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've not included stdout nor null because there currently are no cases where APM Python would need to set them. But if too strict I can add them. |
||
|
||
@classmethod | ||
def default_type(cls): | ||
"""Returns integer representation of default log type""" | ||
return cls.log_types["STDERR"] | ||
|
||
@classmethod | ||
def disabled_type(cls): | ||
"""Returns integer representation of disabled log type""" | ||
return cls.log_types["DISABLED"] | ||
|
||
@classmethod | ||
def file_type(cls): | ||
"""Returns integer representation of to-file log type""" | ||
return cls.log_types["FILE"] | ||
|
||
@classmethod | ||
def is_valid_log_type(cls, log_type): | ||
"""Returns True if the provided type is a valid interger representation of log type, False otherwise.""" | ||
try: | ||
log_type = int(log_type) | ||
return bool(log_type in list(cls.log_types.values())) | ||
except (ValueError, TypeError): | ||
return cls.default_type() | ||
|
||
|
||
class ApmLoggingLevel: | ||
"""Abstract mapping class providing a conversion between solarwinds_apm agent logging level and Python logging module | ||
"""Mapping class providing a conversion between solarwinds_apm library logging level and Python logging module | ||
logging levels. | ||
The solarwinds_apm package has seven different log levels, which are defined in the debug_levels dictionary. | ||
The solarwinds_apm package has six main log levels, which are defined in the debug_levels dictionary. | ||
There is also a special 7th OBOE_DEBUG_DISABLE for disabling logging, as there is no "disabled" level in Python logging nor agent logging. | ||
""" | ||
|
||
# maps string representation of solarwinds_apm.sw_logging levels to their integer counterpart | ||
|
@@ -75,7 +110,7 @@ def default_level(cls): | |
|
||
@classmethod | ||
def is_valid_level(cls, level): | ||
"""Returns True if the provided level is a valid interger representation of a solarwinds_apm.sw_logging level, | ||
"""Returns True if the provided level is a valid integer representation of a solarwinds_apm.sw_logging level, | ||
False otherwise.""" | ||
try: | ||
level = int(level) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
13.0.0 | ||
14.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Moved this up here instead of in
_set_config_value
for clarity and so only called once.