Run homebrew commands while simultanously logging to a file
Find a file
robocopAlpha 96456cef6e brewlog is installed in the same place as homebrew
commit 34f328de59
Author: robocopAlpha <35454738+robocopAlpha@users.noreply.github.com>
Date:   Tue Aug 4 13:55:02 2020 +0300

    Update install.sh

    Fix checking if the installation location is writable or not

To ensure that "brewlog" is in the same path as "brew"
commit 6296379a55
Author: robocopAlpha <35454738+robocopAlpha@users.noreply.github.com>
Date:   Tue Aug 4 13:50:33 2020 +0300

    change order of checking shopt nocasematch

commit 6889284f6b
Author: robocopAlpha <35454738+robocopAlpha@users.noreply.github.com>
Date:   Tue Aug 4 13:48:20 2020 +0300

    Installs in the same place as homebrew

commit f67e850575
Author: robocopAlpha <35454738+robocopAlpha@users.noreply.github.com>
Date:   Tue Aug 4 13:37:25 2020 +0300

    Trying to install to the same place as homebrew
2020-08-04 13:56:47 +03:00
brewlog.sh add copyright text 2020-08-04 12:59:19 +03:00
install.sh brewlog is installed in the same place as homebrew 2020-08-04 13:56:47 +03:00
LICENSE Initial commit 2020-08-04 00:03:30 +03:00
README.md Add badges 2020-08-04 13:08:43 +03:00

GitHub license GitHub issues GitHub last commit (branch) Bash

brewlog

Why?

I wrote Brewlog to fulfill a shortcoming I felt homebrew has had for a long time. I got the basic idea from a very old issue on homebrew.

What can brewlog do ?

brewlog is simple solution that can:

  • log homebrew/linuxbrew activity (STDOUT and STDERR)
    • as it is a new command, the user still retains the freedom to run brew [command] [formula] and not log it to the file
  • tail the log file to display selected number of lines.
  • archive the log file (when user invokes the appropriate command).
    • a new log file is created the next time brewlog is invoked after archiving.

Now you'll be easily able to track the changes made by brew upgradeor brew cleanup.

How to use

curl -sSL 'https://raw.githubusercontent.com/robocopAlpha/brewlog/master/install.sh' | bash

# Show help
brewlog --help

# Running homebrew commands
brewlog install ffmpeg
brewlog info ffmpeg

# Even complex brew commands work with brewlog
brewlog list --multiple --versions

Detailed usage

brewlog - allows you to log your homebrew/linuxbrew operations to a file.
Usage:
   brewlog [brew command] [arguments to homebrew]
e.g.
   brewlog install ffmpeg, invokes "brew install ffmpeg" and writes output to a log file.

   --help             Show help
   --brew-help        show brew commands (alias to "brew help")

OPTIONS:
    version            Show brewlog version
    archive            Archives the current log file as .xz
    tail [-n INT]      Show the last "INT" lines from the log file.
                                  (default: last 15 lines)

Homebrew/Linuxbrew Function examples:
  brewlog install [formula]     Install formula
  brewlog uninstall [formula]   Uninstall formula
  brewlog deps [formula]        Show dependencies for formula
  brewlog outdated              Show outdated formulae
  brewlog upgrade [formula]     Upgrade all (or entered) brew formula
  ... ... ...
     Find out more homebrew commands by running "brew --help".

Note:

  • Not to be confused with brew log which shows the commit history (similar to git log).
  • I'm open to a new name, but for now as I personally dont use brew log, I had no “merge conflicts” in my brain while assigning brewlog to achive my desired result of logging brew output :) [IMHO brew history might have been a better name for brew log]