# Path: edwinServer/common/os_helper.py
# def isWindows():
#     '''
#     remark: sys.platform and os.name cannot identify in Jython, so use platform.platform()
#     '''
#     return (platform.platform().find('Windows') >= 0)
# 
# def isJython():
#     return (platform.platform().find('Java') >= 0)


import sys
import logging
from .os_helper import isWindows, isJython
        from logging.handlers import TimedRotatingFileHandler
        from logging.handlers import RotatingFileHandler as RFHandler
        from ..site_packages.ConcurrentLogHandler084.cloghandler import ConcurrentRotatingFileHandler as RFHandler
        from warnings import warn
            from logging.handlers import TimedRotatingFileHandler
            from logging.handlers import RotatingFileHandler as RFHandler
'''
Created on 2013-4-15
'''


# ConcurrentRotatingFileHandler is the best rotating file handler.
# Jython:  ConcurrentRotatingFileHandler does not support Jython.
#         Reason: pywin32 cannot work on windows, fcntl missed on linux
# Windows: If ConcurrentRotatingFileHandler does not install, use TimedRotatingFileHandler rather than RotatingFileHandler.
#         Reason: because RotatingFileHandler will fail when the file size is up to maxBytes on windows,
#                 And TimedRotatingFileHandler will fail if the log file is being written at 23:59
#                 But the chance of TimedRotatingFileHandler failure is less than RotatingFileHandler


root_logger = None
useRotatingFileHandler = True
if isJython():
    if isWindows():
        useRotatingFileHandler = False
    else:
        useRotatingFileHandler = True
else:
    useRotatingFileHandler = True
    try:
    except ImportError, ex:
        print(ex)
        warn("ConcurrentLogHandler package failed to import. Use built-in log handler instead.")

# Path: edwinServer/common/os_helper.py
# def isWindows():
#     '''
#     remark: sys.platform and os.name cannot identify in Jython, so use platform.platform()
#     '''
#     return (platform.platform().find('Windows') >= 0)
# 
# def isJython():
#     return (platform.platform().find('Java') >= 0)


# Path: edwinServer/common/my_logging.py
import sys
import logging
from .os_helper import isWindows, isJython
        from logging.handlers import TimedRotatingFileHandler
        from logging.handlers import RotatingFileHandler as RFHandler
        from ..site_packages.ConcurrentLogHandler084.cloghandler import ConcurrentRotatingFileHandler as RFHandler
        from warnings import warn
            from logging.handlers import TimedRotatingFileHandler
            from logging.handlers import RotatingFileHandler as RFHandler

'''
Created on 2013-4-15
'''


# ConcurrentRotatingFileHandler is the best rotating file handler.
# Jython:  ConcurrentRotatingFileHandler does not support Jython.
#         Reason: pywin32 cannot work on windows, fcntl missed on linux
# Windows: If ConcurrentRotatingFileHandler does not install, use TimedRotatingFileHandler rather than RotatingFileHandler.
#         Reason: because RotatingFileHandler will fail when the file size is up to maxBytes on windows,
#                 And TimedRotatingFileHandler will fail if the log file is being written at 23:59
#                 But the chance of TimedRotatingFileHandler failure is less than RotatingFileHandler


root_logger = None
useRotatingFileHandler = True
if isJython():
    if isWindows():
        useRotatingFileHandler = False
    else:
        useRotatingFileHandler = True
else:
    useRotatingFileHandler = True
    try:
    except ImportError, ex:
        print(ex)
        warn("ConcurrentLogHandler package failed to import. Use built-in log handler instead.")

        if isWindows():