logger.py 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. # coding:utf-8
  2. #!/usr/bin/python
  3. #
  4. # Copyright (c) Contributors to the Open 3D Engine Project.
  5. # For complete copyright and license terms please see the LICENSE at the root of this distribution.
  6. #
  7. # SPDX-License-Identifier: Apache-2.0 OR MIT
  8. #
  9. #
  10. # -------------------------------------------------------------------------
  11. """O3DE DCCsi Logger class. Convenience to reduce boilerplate logging setup"""
  12. # -------------------------------------------------------------------------
  13. # standard imports
  14. import sys
  15. import os
  16. from pathlib import Path
  17. import logging as _logging
  18. from azpy.constants import STR_CROSSBAR
  19. # -------------------------------------------------------------------------
  20. # global scope
  21. _MODULENAME = 'azpy.logger'
  22. _MODULE_PATH = Path(__file__) # To Do: what if frozen?
  23. _LOGGER = _logging.getLogger(_MODULENAME)
  24. _LOGGER.debug(STR_CROSSBAR)
  25. _LOGGER.debug('Initializing: {}'.format(_MODULENAME))
  26. _LOGGER.debug('_MODULE_PATH: {}'.format(_MODULE_PATH.as_posix()))
  27. _LOGGER.info('This stub is an api placeholder: {}'.format(_MODULENAME))
  28. # -------------------------------------------------------------------------
  29. ###########################################################################
  30. # Main Code Block, runs this script as main (testing)
  31. # -------------------------------------------------------------------------
  32. if __name__ == '__main__':
  33. """Run this file as a standalone cli script for testing/debugging"""
  34. import sys
  35. # return
  36. sys.exit()