Changeset 3413 for pykota/trunk/pykota/loggers/system.py
- Timestamp:
- 09/27/08 22:02:37 (16 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/loggers/system.py
r3411 r3413 8 8 # the Free Software Foundation, either version 3 of the License, or 9 9 # (at your option) any later version. 10 # 10 # 11 11 # This program is distributed in the hope that it will be useful, 12 12 # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 14 # GNU General Public License for more details. 15 # 15 # 16 16 # You should have received a copy of the GNU General Public License 17 17 # along with this program. If not, see <http://www.gnu.org/licenses/>. … … 36 36 """Opens the logging subsystem.""" 37 37 syslog.openlog("PyKota", 0, syslog.LOG_LPR) 38 39 def __del__(self) : 38 39 def __del__(self) : 40 40 """Ensures the logging subsystem is closed.""" 41 41 syslog.closelog() 42 42 43 43 def log_message(self, message, level="info") : 44 44 """Sends the message to syslog.""" … … 47 47 "DEBUG").upper(), \ 48 48 syslog.LOG_DEBUG) 49 try : 49 try : 50 50 message = message.strip().encode(sys.stdout.encoding or "UTF-8", \ 51 51 "replace") 52 except UnicodeDecodeError : 52 except UnicodeDecodeError : 53 53 pass 54 54 syslog.syslog(priority, "(PID %s) : %s" % (os.getpid(), message))