provide a method for easy logging (instead of using print statements)
This commit is contained in:
		
							parent
							
								
									0001154f4d
								
							
						
					
					
						commit
						505015e791
					
				
					 1 changed files with 5 additions and 0 deletions
				
			
		|  | @ -20,6 +20,7 @@ | ||||||
| A generic view class. | A generic view class. | ||||||
| """ | """ | ||||||
| 
 | 
 | ||||||
|  | from logging import getLogger | ||||||
| from zope.app.pagetemplate import ViewPageTemplateFile | from zope.app.pagetemplate import ViewPageTemplateFile | ||||||
| from zope.app.security.interfaces import IUnauthenticatedPrincipal | from zope.app.security.interfaces import IUnauthenticatedPrincipal | ||||||
| from zope.interface import Interface, implements | from zope.interface import Interface, implements | ||||||
|  | @ -155,3 +156,7 @@ class GenericView(object): | ||||||
|     def currentYear(self): |     def currentYear(self): | ||||||
|         return cybertools.util.date.year() |         return cybertools.util.date.year() | ||||||
| 
 | 
 | ||||||
|  |     def logInfo(self, message, logName='cybertools'): | ||||||
|  |         logger = getLogger(logName) | ||||||
|  |         logger.info(message) | ||||||
|  | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue