def log(args):
    """
    Subcommand to log file system events to the console.

    :param args:
        Command line argument options.
    """
    from reloadium.vendored.watchdog.utils import echo
    from reloadium.vendored.watchdog.tricks import LoggerTrick

    if args.trace:
        echo.echo_class(LoggerTrick)

    patterns, ignore_patterns =\
        parse_patterns(args.patterns, args.ignore_patterns)
    handler = LoggerTrick(patterns=patterns,
                          ignore_patterns=ignore_patterns,
                          ignore_directories=args.ignore_directories)
    if args.debug_force_polling:
        from reloadium.vendored.watchdog.observers.polling import PollingObserver as Observer
    elif args.debug_force_kqueue:
        from reloadium.vendored.watchdog.observers.kqueue import KqueueObserver as Observer
    elif args.debug_force_winapi_async:
        from reloadium.vendored.watchdog.observers.read_directory_changes_async import\
            WindowsApiAsyncObserver as Observer
    elif args.debug_force_winapi:
        from reloadium.vendored.watchdog.observers.read_directory_changes import\
            WindowsApiObserver as Observer
    elif args.debug_force_inotify:
        from reloadium.vendored.watchdog.observers.inotify import InotifyObserver as Observer
    elif args.debug_force_fsevents:
        from reloadium.vendored.watchdog.observers.fsevents import FSEventsObserver as Observer
    else:
        # Automatically picks the most appropriate observer for the platform
        # on which it is running.
        from reloadium.vendored.watchdog.observers import Observer
    observer = Observer(timeout=args.timeout)
    observe_with(observer, handler, args.directories, args.recursive)

    Subcommand to log file system events to the console.

    :param args:
        Command line argument options.
    
src/watchdog/watchmedo.py