← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #173063]: Is there any import files which we use to create a custom log file like the Tempfile module

 

Question #173063 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/173063

    Status: Open => Answered

RaiMan proposed the following answer:
The log file is created in
def __initLogFile(self): 

with this statement:
(self.logFileHandle, self.logFilePath) = tempfile.mkstemp(suffix = self.logFileSuffix, prefix = self.logFilePrefix, dir = self.logFileDir)

before leaving the script finally
import shutil # at beginning of script

# action
shutil.move(myLogger.logFilePath, "path-including-filename-you-like")

this will rename the log file

Since this will only work, if the script executes this statement in any
case, it might not be sufficient for you.

So before subclassing logger and overwriting __initLogFile, you might
check, wether the two parameters prefix and suffix might do the job.

myLogger = Logger(dir = currentDir, prefix = "some-prefix", suffix =
"some-suffix")

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.