Python Forum
What is the best way to set application-wide config values?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What is the best way to set application-wide config values?
#1
I want to write a custom logger and I want to configure the logger once, and import the logger in multiple classes. I would like to do this without using the singleton decorator. The default logger (https://docs.python.org/2/howto/logging....le-modules)[supports logging] from multiple modules, but I'm not sure how this is accomplished. If I have an application where I want to start the application, set the configuration for my own module, and import that module into other classes in the application so that I an access the configuration information, what is the best way to accomplish that?
Reply


Messages In This Thread
What is the best way to set application-wide config values? - by ajorona - May-07-2020, 04:59 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to transform from wide to long format in python shantanu97 1 1,667 Nov-21-2021, 11:53 AM
Last Post: buran
  Updating a config file [solved] ebolisa 8 2,638 Nov-04-2021, 10:20 AM
Last Post: Gribouillis
  How to send data from a python application to an external application aditya_rajiv 1 2,204 Jul-26-2021, 06:00 AM
Last Post: ndc85430
  Is there a library for recursive object creation using config objects johsmi96 0 1,864 May-03-2021, 08:09 PM
Last Post: johsmi96
  help with pytesseract.image_to_string(savedImage, config='--psm 11')iamge to string korenron 0 2,723 Apr-29-2021, 10:08 AM
Last Post: korenron
  Importing Program Wide JarredAwesome 4 2,217 Sep-07-2020, 04:34 PM
Last Post: JarredAwesome
  Config file update Olivier74 0 1,496 Aug-18-2020, 03:36 PM
Last Post: Olivier74
  Config file entry as list versus string? taziuk 2 1,846 Apr-25-2020, 12:01 PM
Last Post: ndc85430
  output a list of random numbers 'x' columns wide adityavpratap 4 3,046 Jan-13-2020, 05:32 PM
Last Post: perfringo
  logging: child module unable to get parent config jerryxiao 3 3,395 Apr-09-2019, 04:17 AM
Last Post: jerryxiao

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020