Page 1 of 1

Creating a log file

Published: April 9, 2020 - 2:44 PM
by Patrice_minagri
Good morning,

Today I'm trying to go a little further by attempting to create a log file during the installation of a package.

I created a quick package with the following code:

Code: Select all

# -*- coding: utf-8 -*-
from setuphelpers import *
import logging

uninstallkey = []
softname = 'Everything 1.4.1.969'

def install():
    logging.basicConfig(level=logging.DEBUG,filename='%appdata%\everything.log',filemode='w',format='%(asctime)s - %(levelname)s - %(message)s')

    if not installed_softwares(softname):
        print('installing agri-everything')
        logging.info("Début de l'installation")
        install_exe_if_needed("Everything-1.4.1.969.x64-Setup.exe",'/S',key='',min_version='1.4.1.969')
Even if the package is not in error, it does not create any log file.

I therefore rely on your experience to ask where I am making a mistake or if there is another way to generate a log file.

Thank you so much.

Patrice