.. _f-flog: module ``loghelper.flog`` ========================= Short summary +++++++++++++ module ``pyquickhelper.loghelper.flog`` logging functionalities The function fLOG (or fLOG) is used to logged everything into a log file. :: from pyquickhelper.loghelper.flog import fLOG fLOG(OutputPrint = True) # the logs are also displayed in the output stream fLOG(LogPath = "...") # chanages the path returned by GetPath fLOG("un", "deux", 4, ["gt"]) # log everything in a log file from pyquickhelper.loghelper.flog import GetPath () print GetPath() # return the log path (file temp_log.txt) fLOG(LogPath = "c:/temp/log_path") # change the log path, creates it if it does not exist Functions +++++++++ +--------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | function | truncated documentation | +========================================================================================================+=========================================================================================================================================================================+ | :func:`_check_source ` | Check the existence of a file, downloads it if not existing. | +--------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`_check_url_file ` | If *url* is an url, download the file and return the downloaded if it has already been downloaded, it is not downloaded ... | +--------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`_check_zip_file ` | This function tests if a file is a zip file (extension zip), if it is the case, it unzips it into another file and return ... | +--------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`_first_more_recent ` | Checks if the first file (opened url) is more recent of the second file (path). | +--------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`_get_file_txt ` | build a filename knowing an url, same name but in default_path | +--------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`_get_file_url ` | build a filename knowing an url | +--------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`_this_fLOG ` | Other name private to this module. | +--------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`download ` | Download a file to the folder path_unzip if not present, if the downloading is interrupted, the next time, it will start ... | +--------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`fLOG ` | Builds a message on a single line with the date, it deals with encoding issues. | +--------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`fLOGFormat ` | Formats a message. | +--------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`get_default_value_type ` | | +--------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`get_prefix ` | Returns a prefix for a file based on time. | +--------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`get_relative_path ` | private function, return the relative path or absolute between a folder and a file, use `relpath `_ ... | +--------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`GetLogFile ` | Returns a file name containing the log | +--------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`GetPath ` | returns a path where the log file is stored. | +--------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`GetSepLine ` | Always returns ``\n`` | +--------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`guess_machine_parameter ` | Determines many parameters on this machine: | +--------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`guess_type_list ` | guess the type of a list | +--------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`guess_type_value ` | Guessees the type of a value. | +--------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`guess_type_value_type ` | | +--------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`init ` | initialisation | +--------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`IsEmptyString ` | Empty string or not? | +--------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`load_content_file_with_encoding ` | Tries different encoding to load a file, tries utf8, latin1 and None. | +--------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`noLOG ` | does nothing | +--------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`Print ` | if True, redirect everything which is displayed to the standard output | +--------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`removedirs ` | Removes all files and folders in *folder*. | +--------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`unzip ` | Unzips a file into the temporary folder, the function expects to have only one zipped file. | +--------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Documentation +++++++++++++ .. automodule:: pyquickhelper.loghelper.flog :members: :special-members: __init__ :show-inheritance: