Python Logger Inteface OOP Design [closed]

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;







up vote
1
down vote

favorite












I just want some general feedback on the code I provide below. This is a extremely simple Logger interface I plan on fleshing out and I want to know where to go from here in an OOP manner. Is there any reason to have this interface set up like this? I'm trying to make my code as readable as possible so having LoggerObject = Logger.initialize(arguments) seems like a decent route to take. Or should I get rid of the initialize function and solely use the constructor?



The application this will reside in is based around threaded metric/monitoring shippers. I thought each thread, or any interface, could have it's own Logger object and change it on the fly with the properties in an intuitive manner. Is this a decent approach?



class Logger(object):
def __init__(self):
self._filename = ''
self._date_format = ''

def initialize(self, filename, date_format):
self.filename = filename
self.date_format = date_format

return self

@property
def filename(self):
return self._filename

@filename.setter
def filename(self, filename):
self._filename = filename

@property
def date_format(self):
return self._date_format

@date_format.setter
def date_format(self, date_format):
self._date_format = date_format






share|improve this question













closed as off-topic by hjpotter92, Vogel612♦, Dan Pantry, Sam Onela, Stephen Rauch Mar 26 at 14:18


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review." – hjpotter92, Vogel612, Dan Pantry, Sam Onela, Stephen Rauch
If this question can be reworded to fit the rules in the help center, please edit the question.








  • 1




    I haven't. What are you under the impression that it will do?
    – Clannadqs
    Mar 26 at 13:07






  • 1




    yes. which is why Code Review does not accept hypothetical code.
    – hjpotter92
    Mar 26 at 13:40






  • 2




    Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review.
    – hjpotter92
    Mar 26 at 13:40






  • 1




    But you see, at the current juncture; you're essentially asking us to write your code for you (on either site)! You need to build (and test) something before you can ask about reviews or issues.
    – hjpotter92
    Mar 26 at 13:43






  • 1




    Unfortunately SO has a track record for being unreliable when it comes to migration recommendations. I would recommend you check the site help center before migrating to another site in future, even if someone on SO tells you to :)
    – Dan Pantry
    Mar 26 at 13:47
















up vote
1
down vote

favorite












I just want some general feedback on the code I provide below. This is a extremely simple Logger interface I plan on fleshing out and I want to know where to go from here in an OOP manner. Is there any reason to have this interface set up like this? I'm trying to make my code as readable as possible so having LoggerObject = Logger.initialize(arguments) seems like a decent route to take. Or should I get rid of the initialize function and solely use the constructor?



The application this will reside in is based around threaded metric/monitoring shippers. I thought each thread, or any interface, could have it's own Logger object and change it on the fly with the properties in an intuitive manner. Is this a decent approach?



class Logger(object):
def __init__(self):
self._filename = ''
self._date_format = ''

def initialize(self, filename, date_format):
self.filename = filename
self.date_format = date_format

return self

@property
def filename(self):
return self._filename

@filename.setter
def filename(self, filename):
self._filename = filename

@property
def date_format(self):
return self._date_format

@date_format.setter
def date_format(self, date_format):
self._date_format = date_format






share|improve this question













closed as off-topic by hjpotter92, Vogel612♦, Dan Pantry, Sam Onela, Stephen Rauch Mar 26 at 14:18


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review." – hjpotter92, Vogel612, Dan Pantry, Sam Onela, Stephen Rauch
If this question can be reworded to fit the rules in the help center, please edit the question.








  • 1




    I haven't. What are you under the impression that it will do?
    – Clannadqs
    Mar 26 at 13:07






  • 1




    yes. which is why Code Review does not accept hypothetical code.
    – hjpotter92
    Mar 26 at 13:40






  • 2




    Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review.
    – hjpotter92
    Mar 26 at 13:40






  • 1




    But you see, at the current juncture; you're essentially asking us to write your code for you (on either site)! You need to build (and test) something before you can ask about reviews or issues.
    – hjpotter92
    Mar 26 at 13:43






  • 1




    Unfortunately SO has a track record for being unreliable when it comes to migration recommendations. I would recommend you check the site help center before migrating to another site in future, even if someone on SO tells you to :)
    – Dan Pantry
    Mar 26 at 13:47












up vote
1
down vote

favorite









up vote
1
down vote

favorite











I just want some general feedback on the code I provide below. This is a extremely simple Logger interface I plan on fleshing out and I want to know where to go from here in an OOP manner. Is there any reason to have this interface set up like this? I'm trying to make my code as readable as possible so having LoggerObject = Logger.initialize(arguments) seems like a decent route to take. Or should I get rid of the initialize function and solely use the constructor?



The application this will reside in is based around threaded metric/monitoring shippers. I thought each thread, or any interface, could have it's own Logger object and change it on the fly with the properties in an intuitive manner. Is this a decent approach?



class Logger(object):
def __init__(self):
self._filename = ''
self._date_format = ''

def initialize(self, filename, date_format):
self.filename = filename
self.date_format = date_format

return self

@property
def filename(self):
return self._filename

@filename.setter
def filename(self, filename):
self._filename = filename

@property
def date_format(self):
return self._date_format

@date_format.setter
def date_format(self, date_format):
self._date_format = date_format






share|improve this question













I just want some general feedback on the code I provide below. This is a extremely simple Logger interface I plan on fleshing out and I want to know where to go from here in an OOP manner. Is there any reason to have this interface set up like this? I'm trying to make my code as readable as possible so having LoggerObject = Logger.initialize(arguments) seems like a decent route to take. Or should I get rid of the initialize function and solely use the constructor?



The application this will reside in is based around threaded metric/monitoring shippers. I thought each thread, or any interface, could have it's own Logger object and change it on the fly with the properties in an intuitive manner. Is this a decent approach?



class Logger(object):
def __init__(self):
self._filename = ''
self._date_format = ''

def initialize(self, filename, date_format):
self.filename = filename
self.date_format = date_format

return self

@property
def filename(self):
return self._filename

@filename.setter
def filename(self, filename):
self._filename = filename

@property
def date_format(self):
return self._date_format

@date_format.setter
def date_format(self, date_format):
self._date_format = date_format








share|improve this question












share|improve this question




share|improve this question








edited Mar 23 at 19:54









πάντα ῥεῖ

3,82431126




3,82431126









asked Mar 23 at 19:53









Clannadqs

121




121




closed as off-topic by hjpotter92, Vogel612♦, Dan Pantry, Sam Onela, Stephen Rauch Mar 26 at 14:18


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review." – hjpotter92, Vogel612, Dan Pantry, Sam Onela, Stephen Rauch
If this question can be reworded to fit the rules in the help center, please edit the question.




closed as off-topic by hjpotter92, Vogel612♦, Dan Pantry, Sam Onela, Stephen Rauch Mar 26 at 14:18


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review." – hjpotter92, Vogel612, Dan Pantry, Sam Onela, Stephen Rauch
If this question can be reworded to fit the rules in the help center, please edit the question.







  • 1




    I haven't. What are you under the impression that it will do?
    – Clannadqs
    Mar 26 at 13:07






  • 1




    yes. which is why Code Review does not accept hypothetical code.
    – hjpotter92
    Mar 26 at 13:40






  • 2




    Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review.
    – hjpotter92
    Mar 26 at 13:40






  • 1




    But you see, at the current juncture; you're essentially asking us to write your code for you (on either site)! You need to build (and test) something before you can ask about reviews or issues.
    – hjpotter92
    Mar 26 at 13:43






  • 1




    Unfortunately SO has a track record for being unreliable when it comes to migration recommendations. I would recommend you check the site help center before migrating to another site in future, even if someone on SO tells you to :)
    – Dan Pantry
    Mar 26 at 13:47












  • 1




    I haven't. What are you under the impression that it will do?
    – Clannadqs
    Mar 26 at 13:07






  • 1




    yes. which is why Code Review does not accept hypothetical code.
    – hjpotter92
    Mar 26 at 13:40






  • 2




    Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review.
    – hjpotter92
    Mar 26 at 13:40






  • 1




    But you see, at the current juncture; you're essentially asking us to write your code for you (on either site)! You need to build (and test) something before you can ask about reviews or issues.
    – hjpotter92
    Mar 26 at 13:43






  • 1




    Unfortunately SO has a track record for being unreliable when it comes to migration recommendations. I would recommend you check the site help center before migrating to another site in future, even if someone on SO tells you to :)
    – Dan Pantry
    Mar 26 at 13:47







1




1




I haven't. What are you under the impression that it will do?
– Clannadqs
Mar 26 at 13:07




I haven't. What are you under the impression that it will do?
– Clannadqs
Mar 26 at 13:07




1




1




yes. which is why Code Review does not accept hypothetical code.
– hjpotter92
Mar 26 at 13:40




yes. which is why Code Review does not accept hypothetical code.
– hjpotter92
Mar 26 at 13:40




2




2




Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review.
– hjpotter92
Mar 26 at 13:40




Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review.
– hjpotter92
Mar 26 at 13:40




1




1




But you see, at the current juncture; you're essentially asking us to write your code for you (on either site)! You need to build (and test) something before you can ask about reviews or issues.
– hjpotter92
Mar 26 at 13:43




But you see, at the current juncture; you're essentially asking us to write your code for you (on either site)! You need to build (and test) something before you can ask about reviews or issues.
– hjpotter92
Mar 26 at 13:43




1




1




Unfortunately SO has a track record for being unreliable when it comes to migration recommendations. I would recommend you check the site help center before migrating to another site in future, even if someone on SO tells you to :)
– Dan Pantry
Mar 26 at 13:47




Unfortunately SO has a track record for being unreliable when it comes to migration recommendations. I would recommend you check the site help center before migrating to another site in future, even if someone on SO tells you to :)
– Dan Pantry
Mar 26 at 13:47















active

oldest

votes






















active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes

Popular posts from this blog

Greedy Best First Search implementation in Rust

Function to Return a JSON Like Objects Using VBA Collections and Arrays

C++11 CLH Lock Implementation