Open JosePizarro3 opened 1 month ago
the parse function takes in the logger as arg which should be passed on to other functions. i usually make it as class attrb. you can also define it as var in the module in some cases
The only solution is to share the same logger object among functions. That would be either a decorator or a class attribute, as Alvin suggested. Given our structure, I would use a class decorator that prepends the section name.
Let me first merge my branch before overhauling the schema at this scale, though.
Ok, I think class attribute is the most consistent one. I will fix it elsewhere later.
Ok, I think class attribute is the most consistent one. I will fix it elsewhere later.
Indeed, and if you apply it as a class decorator, your implementation will be more modular. How you prefer.
Ok, I think class attribute is the most consistent one. I will fix it elsewhere later.
Indeed, and if you apply it as a class decorator, your implementation will be more modular. How you prefer.
Why a class decorator? I think an input to each class __init__
should be enough, right?
Ok, I think class attribute is the most consistent one. I will fix it elsewhere later.
Indeed, and if you apply it as a class decorator, your implementation will be more modular. How you prefer.
Why a class decorator? I think an input to each class
__init__
should be enough, right?
Please don't move it to the __init__
args, that just displaces the issue, rather than solving it.
Instead, you want a function called during (class?) instantiation that reads in the context.
That functions could either be inherited or set as a class decorator to the sections. Either are fine for our usage.
@ladinesa @ndaelman-hu I have a question regarding the logger. Right now, I was passing it as an input of our functions, but I realize this might not be the best practice.
Do you know what is the best way of handling this? Define it in the class or in the modules?