-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #43 from ni/enable_disable_logging
Add methods to get the logging state and enable/disable channel logging.
- Loading branch information
Showing
5 changed files
with
199 additions
and
3 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import os | ||
import sys | ||
|
||
from flexlogger.automation import Application | ||
|
||
|
||
def main(project_path): | ||
"""Launch FlexLogger, open a project, and disables a channel.""" | ||
with Application.launch() as app: | ||
project = app.open_project(path=project_path) | ||
channel_name = input("Enter the name of the channel to disable logging: ") | ||
channel_specification = project.open_channel_specification_document() | ||
channel_specification.set_channel_logging_enabled(channel_name, False) | ||
print("Channel logging disabled. Press Enter to close the project...") | ||
input() | ||
project.close() | ||
return 0 | ||
|
||
|
||
if __name__ == "__main__": | ||
argv = sys.argv | ||
if len(argv) < 2: | ||
print("Usage: %s <path of project to open>" % os.path.basename(__file__)) | ||
sys.exit() | ||
project_path_arg = argv[1] | ||
sys.exit(main(project_path_arg)) |
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