Skip to main content

Append date and time before text

Project description

mklog is a python program that converts standard input, content of files, or output of a command in a log-like format, i.e. current date and time is prepended to each line.

Run mklog –help for the list of available options; see examples below.

Example

Download using wget:

$ mklog  -c wget https://archive.org/download/Popeye_Nearlyweds/Popeye_Nearlyweds.ogv
2015-02-05 13:13:41 --2015-02-05 13:13:41--  http://t/
2015-02-05 13:13:41 Résolution de t (t) échec : Nom ou service inconnu.
2015-02-05 13:13:41 wget : impossible de résoudre l'adresse de l'hôte « t »
2015-02-05 13:13:41 --2015-02-05 13:13:41--  https://archive.org/download/Popeye_Nearlyweds/Popeye_Nearlyweds.ogv
2015-02-05 13:13:41 Résolution de archive.org (archive.org) 207.241.224.2
2015-02-05 13:13:41 Connexion à archive.org (archive.org)|207.241.224.2|:443 connecté.
2015-02-05 13:13:42 requête HTTP transmise, en attente de la réponse 302 Moved Temporarily
2015-02-05 13:13:42 Emplacement : https://ia700502.us.archive.org/6/items/Popeye_Nearlyweds/Popeye_Nearlyweds.ogv [suivant]
2015-02-05 13:13:42 --2015-02-05 13:13:42--  https://ia700502.us.archive.org/6/items/Popeye_Nearlyweds/Popeye_Nearlyweds.ogv
2015-02-05 13:13:42 Résolution de ia700502.us.archive.org (ia700502.us.archive.org) 207.241.237.122
2015-02-05 13:13:42 Connexion à ia700502.us.archive.org (ia700502.us.archive.org)|207.241.237.122|:443 connecté.
2015-02-05 13:13:43 requête HTTP transmise, en attente de la réponse 200 OK
2015-02-05 13:13:43 Taille : 26698780 (25M) [video/ogg]
2015-02-05 13:13:43 Sauvegarde en : « Popeye_Nearlyweds.ogv »
2015-02-05 13:13:43
2015-02-05 13:13:44      0K .......... .......... .......... .......... ..........  0%  126K 3m26s
[...]
2015-02-05 13:14:18  26000K .......... .......... .......... .......... .......... 99%  541K 0s
2015-02-05 13:14:18  26050K .......... .......... ...                             100% 5,80M=34s
2015-02-05 13:14:18
2015-02-05 13:14:18 2015-02-05 13:14:18 (762 KB/s)  « Popeye_Nearlyweds.ogv » sauvegardé [26698780/26698780]
2015-02-05 13:14:18
2015-02-05 13:14:18 Terminé  2015-02-05 13:14:18 
2015-02-05 13:14:18 Temps total effectif : 37s
2015-02-05 13:14:18 Téléchargés : 1 fichiers, 25M en 34s (762 KB/s)

Monitor logs (which are not dated):

$ tail -f /var/log/gdm3/\:0.log | mklog

What’s new?

See changelog.

Download and install

See the end of list for a (quick and dirty) Debian package.

  • From sources:

  • With pip:

    pip install mklog
  • Quick and dirty Debian (and Ubuntu?) package

    This requires stdeb to be installed:

    python3 setup.py --command-packages=stdeb.command bdist_deb
    sudo dpkg -i deb_dist/mklog-<VERSION>_all.deb

See also

See also (other program with the same purpose):

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mklog-1.3.0.tar.gz (28.8 kB view details)

Uploaded Source

Built Distribution

mklog-1.3.0-py3-none-any.whl (20.3 kB view details)

Uploaded Python 3

File details

Details for the file mklog-1.3.0.tar.gz.

File metadata

  • Download URL: mklog-1.3.0.tar.gz
  • Upload date:
  • Size: 28.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for mklog-1.3.0.tar.gz
Algorithm Hash digest
SHA256 3e6261213777420465c40be242cac296c61d576382724608405897618e23c795
MD5 7de241fd58575bb47aa18bbae04274ce
BLAKE2b-256 18bbbcac217e81b09cdab4003be704ecdf103c64d26d8e9cb79375a72094e5b0

See more details on using hashes here.

File details

Details for the file mklog-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: mklog-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 20.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for mklog-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5fe9551a1b93a1bd25f2410414b5e15893329f82faa81d240d0a01888f759664
MD5 4485961da5bc329f5d157f9abe7ebe47
BLAKE2b-256 2fdc17dad6221767cac0b9f07cbf2184fa6076b860c542b580dd9cb7fa4b610d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page