# watchme.logger package

## Submodules

## watchme.logger.message module

Copyright (C) 2019 Vanessa Sochat.

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

The watcher is actually a connection to crontab. This is what helps to schedule the watched to check for changes at some frequency, and update the files.

class `watchme.logger.message.``WatchMeMessage`(MESSAGELEVEL=None)

  Bases: `object`

  `abort`(message)
  `addColor`(level, text)

    addColor to the prompt (usually prefix) if terminal supports, and specified to do so

  `critical`(message)
  `custom`(prefix, message='', color='\x1b[95m')
  `debug`(message)
  `emit`(level, message, prefix=None, color=None)

    emit is the main function to print the message optionally with a prefix :param level: the level of the message :param message: the message to print :param prefix: a prefix for the message

  `emitError`(level)

    determine if a level should print to stderr, includes all levels but INFO and QUIET

  `emitOutput`(level)

    determine if a level should print to stdout only includes INFO

  `error`(message)
  `exit`(message, error_code=255)
  `get_logs`(join_newline=True)

    ‘get_logs will return the complete history, joined by newline (default) or as is.

  `info`(message)
  `isEnabledFor`(messageLevel)

    check if a messageLevel is enabled to emit a level

  `is_quiet`()

    is_quiet returns true if the level is under 1

  `log`(message)
  `newline`()
  `show_progress`(iteration, total, length=40, min_level=0, prefix=None, carriage_return=True, suffix=None, symbol=None)

    create a terminal progress bar, default bar shows for verbose+ :param iteration: current iteration (Int) :param total: total iterations (Int) :param length: character length of bar (Int)

  `spinner` = <watchme.logger.spinner.Spinner object>
  `table`(rows, col_width=2)

    table will print a table of entries. If the rows is a dictionary, the keys are interpreted as column names. if not, a numbered list is used.

  `useColor`()

    useColor will determine if color should be added to a print. Will check if being run in a terminal, and if has support for asci

  `verbose`(message)
  `verbose1`(message)
  `verbose2`(message)
  `verbose3`(message)
  `warning`(message)
  `write`(stream, message)

    write will write a message to a stream, first checking the encoding

`watchme.logger.message.``convert2boolean`(arg)

  convert2boolean is used for environmental variables that must be returned as boolean

`watchme.logger.message.``get_logging_level`()

  get_logging_level will configure a logging to standard out based on the user’s selected level, which should be in an environment variable called MESSAGELEVEL. if MESSAGELEVEL is not set, the maximum level (5) is assumed (all messages).

`watchme.logger.message.``get_user_color_preference`()

## watchme.logger.namer module

Copyright (C) 2019 Vanessa Sochat.

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

class `watchme.logger.namer.``RobotNamer`

  Bases: `object`

  `generate`(delim='-', length=4, chars='0123456789')
    Generate a robot name. Inspiration from Haikunator, but much more

      poorly implemented ;)

    Parameters

      - delim (Delimiter)

      - length (TokenLength)

      - chars (TokenChars)

`watchme.logger.namer.``main`()

## watchme.logger.progress module

### clint.textui.progress

A derivation of clint version, to not introduce a dependency and add custom functionality. Credit to base code goes to https://github.com/kennethreitz/clint/blob/master/clint/textui/progress.py

class `watchme.logger.progress.``ProgressBar`(label='', width=32, hide=None, empty_char=' ', filled_char='-', expected_size=None, every=1)

  Bases: `object`

  `done`()
  `format_time`(seconds)
  `show`(progress, count=None)

`watchme.logger.progress.``bar`(it, label='', width=32, hide=None, empty_char=' ', filled_char='-', expected_size=None, every=1)

  Progress iterator. Wrap your iterables with it.

## watchme.logger.spinner module

Copyright (C) 2019 Vanessa Sochat.

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

The watcher is actually a connection to crontab. This is what helps to schedule the watched to check for changes at some frequency, and update the files.

class `watchme.logger.spinner.``Spinner`(delay=None, generator=None)

  Bases: `object`

  static `balloons_cursor`()
  static `changing_arrows`()
  `delay` = 0.1
  `run`()
  `select_generator`(generator)
  `spinning` = False
  static `spinning_cursor`()
  `start`()
  `stop`()

## Module contents