<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def fileprint(filename, category, level=logging.DEBUG, maxBytes=1024*10124*100, backupCount=0):
 """ Print files by file size. filename string, file name category string, category path of logs file in log directory level enumerated type of logging module, restrict whether logs to be printed or not maxBytes int, max limit of file size backupCount int, allowed numbers of file copys """

    path = os.path.join(CFG.filedir, category, filename)

    # Initialize filer
    filer = logging.getLogger(filename)
    frt = logging.Formatter('%(message)s')

    hdr = RotatingFileHandler(path, 'a', maxBytes, backupCount, 'utf-8')
    hdr.setFormatter(frt)
    hdr._name = '##_rfh_##'
    already_in = False
    for _hdr in filer.handlers:
        if _hdr._name == '##_rfh_##':
            already_in = True
            break
    if not already_in:
        filer.addHandler(hdr)

    hdr = logging.StreamHandler(sys.stdout)
    hdr.setFormatter(frt)
    hdr._name = '##_sh_##'
    already_in = False
    for _hdr in filer.handlers:
        if _hdr._name == '##_sh_##':
            already_in = True
    if not already_in:
        filer.addHandler(hdr)

    filer.setLevel(level)
    def _wraper(*args):
        if not args:
            return
        encoding = 'utf8' if os.name == 'posix' else 'gbk'
        args = [_cu(a, encoding) for a in args]
        filer.info(' '.join(args))
    return _wraper, filer