1
0
mirror of https://github.com/elisspace/autopsy.git synced 2026-08-30 16:11:57 +00:00

python logger logs appropriate logging source

This commit is contained in:
sidheshenator
2015-05-26 14:39:55 -04:00
parent ad779792e0
commit abe801e151
3 changed files with 9 additions and 6 deletions

View File

@@ -40,6 +40,7 @@
import jarray
from java.lang import System
from java.util.logging import Level
from javax.swing import JCheckBox
from javax.swing import BoxLayout
from org.sleuthkit.autopsy.casemodule import Case
@@ -117,12 +118,12 @@ class SampleFileIngestModuleWithUI(FileIngestModule):
# TODO: Add any setup code that you need here.
def startUp(self, context):
self.logger = Logger.getLogger(SampleFileIngestModuleWithUIFactory.moduleName)
# As an example, determine if user configured a flag in UI
if self.local_settings.getFlag():
self.logger.info("flag is set")
self.logger.logp(Level.INFO, SampleFileIngestModuleWithUI.__name__, "startUp", "flag is set")
else:
self.logger.info("flag is not set")
self.logger.logp(Level.INFO, SampleFileIngestModuleWithUI.__name__, "startUp", "flag is not set")
# Throw an IngestModule.IngestModuleException exception if there was a problem setting up
# raise IngestModuleException(IngestModule(), "Oh No!")