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

@ -33,6 +33,7 @@
import jarray
from java.lang import System
from java.util.logging import Level
from org.sleuthkit.datamodel import SleuthkitCase
from org.sleuthkit.datamodel import AbstractFile
from org.sleuthkit.datamodel import ReadContentInputStream
@ -113,7 +114,7 @@ class SampleJythonDataSourceIngestModule(DataSourceIngestModule):
files = fileManager.findFiles(dataSource, "%test%")
numFiles = len(files)
logger.info("found " + str(numFiles) + " files")
logger.logp(Level.INFO, SampleJythonDataSourceIngestModule.__name__, "process", "found " + str(numFiles) + " files")
progressBar.switchToDeterminate(numFiles)
fileCount = 0;
for file in files:
@ -122,7 +123,7 @@ class SampleJythonDataSourceIngestModule(DataSourceIngestModule):
if self.context.isJobCancelled():
return IngestModule.ProcessResult.OK
logger.info("Processing file: " + file.getName())
logger.logp(Level.INFO, SampleJythonDataSourceIngestModule.__name__, "process", "Processing file: " + file.getName())
fileCount += 1
# Make an artifact on the blackboard. TSK_INTERESTING_FILE_HIT is a generic type of

View File

@ -33,6 +33,7 @@
import jarray
from java.lang import System
from java.util.logging import Level
from org.sleuthkit.datamodel import SleuthkitCase
from org.sleuthkit.datamodel import AbstractFile
from org.sleuthkit.datamodel import ReadContentInputStream
@ -99,7 +100,7 @@ class SampleJythonFileIngestModule(FileIngestModule):
# For an example, we will flag files with .txt in the name and make a blackboard artifact.
if file.getName().find(".txt") != -1:
self.logger.info("Found a text file: " + file.getName())
self.logger.logp(Level.INFO, SampleJythonFileIngestModule.__name__, "process", "Found a text file: " + file.getName())
self.filesFound+=1
# Make an artifact on the blackboard. TSK_INTERESTING_FILE_HIT is a generic type of

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
@ -120,9 +121,9 @@ class SampleFileIngestModuleWithUI(FileIngestModule):
# 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!")