ats_utilities.logging package¶
Submodules¶
Module contents¶
- Module
- __init__.py
- Copyright
- Copyright (C) 2017 Vladimir Roncevic <elektron.ronca@gmail.com> ats_utilities is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. ats_utilities is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
- Info
- Defined class ATSLogger with attribute(s) and method(s). Created API for ATS logging mechanism.
-
class
ats_utilities.logging.
ATSLogger
(ats_name, ats_log_file, verbose=False)[source]¶ Bases:
ats_utilities.logging.ats_logger_name.ATSLoggerName
,ats_utilities.logging.ats_logger_file.ATSLoggerFile
,ats_utilities.logging.ats_logger_status.ATSLoggerStatus
Defined class ATSLogger with attribute(s) and method(s). Created API for ATS logging mechanism. It defines:
attributes: LOG_MSG_FORMAT - log message format.LOG_DATE_FORMAT - log date format.ATS_DEBUG - debug log level.ATS_WARNING - warning log level.ATS_CRITICAL - critical log level.ATS_ERROR - error log level.ATS_INFO - info log level.__verbose - enable/disable verbose option.methods: __init__ - initial constructor.write_log - write message to log file.__str__ - str dunder method for ATSLogger.-
ATS_CRITICAL
= 50¶
-
ATS_DEBUG
= 10¶
-
ATS_ERROR
= 40¶
-
ATS_INFO
= 20¶
-
ATS_WARNING
= 30¶
-
LOG_DATE_FORMAT
= '%m/%d/%Y %I:%M:%S %p'¶
-
LOG_MSG_FORMAT
= '%(asctime)s - %(levelname)s - %(message)s'¶
-
VERBOSE
= 'ats_utilities::logging'¶
-
write_log
(message, ctrl, verbose=False)[source]¶ Write message to log file.
Parameters: - message (<str>) – log message.
- ctrl (<int>) – control flag (debug, warning, critical, errors, info).
- verbose (<bool>) – enable/disable verbose option.
Returns: boolean status, True (success) | False.
Return type: <bool>
Exceptions: ATSTypeError | ATSBadCallError
-