<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def printlog(self, string, verbose=None, flush=False):
 """Prints the given string to a logfile if logging is on, and to screen if verbosity is on."""

        if self.writelog:
            self.logger.info(string)
        if verbose or (self.verbose and verbose is None):
            print(string, flush=flush)