linux watch log file code example

Example 1: linux show log file real time

$ sudo tail -f /var/log/apache2/access.log

Example 2: debug.log

Debug.Log("Whatever you want your output debug console to display in Unity");
// can take all types of values.
// and don't forget the semi-colon.

Example 3: print loggibng.info to file

import logging.config
if __name__ == '__main__':
    # Configure the logger
    # loggerConfigFileName: The name and path of your configuration file
    logging.config.fileConfig(path.normpath(loggerConfigFileName))

    # Create the logger
    # Admin_Client: The name of a logger defined in the config file
    mylogger = logging.getLogger('Admin_Client')

    msg='Bite Me'
    myLogger.debug(msg)
    myLogger.info(msg)
    myLogger.warn(msg)
    myLogger.error(msg)
    myLogger.critical(msg)

    # Shut down the logger
    logging.shutdown()