Log file location moved to COnfigs.py from Logger.py On branch python-cli modified: components/org.apache.stratos.python.cli/src/main/python/cli/Configs.py modified: components/org.apache.stratos.python.cli/src/main/python/cli/Logging.py
Signed-off-by: Imesh Gunaratne <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/stratos/repo Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/1b76129a Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/1b76129a Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/1b76129a Branch: refs/heads/stratos-4.1.x Commit: 1b76129aaa2f35d4f47858ea702b98b3d8913bc8 Parents: ba5440c Author: Milindu Sanoj Kumarage <[email protected]> Authored: Sat Jun 13 17:11:58 2015 +0530 Committer: Imesh Gunaratne <[email protected]> Committed: Tue Oct 13 16:32:44 2015 +0530 ---------------------------------------------------------------------- .../src/main/python/cli/Configs.py | 3 +++ .../src/main/python/cli/Logging.py | 14 +++++--------- 2 files changed, 8 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/stratos/blob/1b76129a/components/org.apache.stratos.python.cli/src/main/python/cli/Configs.py ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.python.cli/src/main/python/cli/Configs.py b/components/org.apache.stratos.python.cli/src/main/python/cli/Configs.py index e98dcb6..f85b4cc 100644 --- a/components/org.apache.stratos.python.cli/src/main/python/cli/Configs.py +++ b/components/org.apache.stratos.python.cli/src/main/python/cli/Configs.py @@ -5,6 +5,9 @@ stratos_prompt = "stratos> " stratos_dir = "~/.stratos" log_file_name = "stratos-cli.log" +stratos_dir_path = os.path.expanduser(stratos_dir) +log_file_path = stratos_dir_path+log_file_name + Stratos_url = os.getenv('STRATOS_URL', None) Stratos_username = os.getenv('STRATOS_USERNAME', None) Stratos_password = os.getenv('STRATOS_PASSWORD', None) \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/1b76129a/components/org.apache.stratos.python.cli/src/main/python/cli/Logging.py ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.python.cli/src/main/python/cli/Logging.py b/components/org.apache.stratos.python.cli/src/main/python/cli/Logging.py index f149913..b843dfe 100644 --- a/components/org.apache.stratos.python.cli/src/main/python/cli/Logging.py +++ b/components/org.apache.stratos.python.cli/src/main/python/cli/Logging.py @@ -2,16 +2,12 @@ import logging import os import Configs -stratos_dir_path = os.path.expanduser(Configs.stratos_dir) -log_file_path = stratos_dir_path+Configs.log_file_name - -if not os.path.exists(stratos_dir_path): +if not os.path.exists(Configs.stratos_dir_path): try: - os.makedirs(stratos_dir_path) - logging.info("Created directory: "+stratos_dir_path) + os.makedirs(Configs.stratos_dir_path) + logging.info("Created directory: "+Configs.stratos_dir_path) except OSError: - logging.warning("Failed to create directory: "+stratos_dir_path) - + logging.warning("Failed to create directory: "+Configs.stratos_dir_path) -logging.basicConfig(filename=log_file_path, level=logging.DEBUG) +logging.basicConfig(filename=Configs.log_file_path, level=logging.DEBUG)
