Skip to content

Commit

Permalink
Merge pull request #4 from molovo/version-0.2.x
Browse files Browse the repository at this point in the history
Release 0.2.0
  • Loading branch information
molovo committed Sep 14, 2016
2 parents b76838c + 56d3bae commit 8666df6
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions lj
Original file line number Diff line number Diff line change
Expand Up @@ -105,22 +105,22 @@ function _lumberjack() {
l:=loglevel -level:=loglevel

# If the help option is passed, output usage information and exit
if [[ $help ]]; then
if [[ -n $help ]]; then
_lumberjack_usage
exit 0
fi

# If the version option is passed, output the version and exit
if [[ $version ]]; then
if [[ -n $version ]]; then
echo "0.1.1"
exit 0
fi

# If the logfile option is passed, set the current logfile
# for the parent process ID
if [[ $logfile ]]; then
if [[ -n $logfile ]]; then
shift logfile
file=$(realpath $logfile)
file=$logfile

# Create the log file if it doesn't exist
if [[ ! -f $file ]]; then
Expand All @@ -130,15 +130,17 @@ function _lumberjack() {

# If the loglevel option is passed, set the current loglevel
# for the parent process ID
if [[ $loglevel ]]; then
if [[ -n $loglevel ]]; then
shift loglevel
level=$_log_levels[$loglevel]
elif [[ -z $level ]]; then
fi

if [[ -z $level ]]; then
level=5
fi

# Check if we're setting options rather than logging
if [[ $logfile || $loglevel ]]; then
if [[ -n $logfile || -n $loglevel ]]; then
# Store the state
echo "$level $file" >! $statefile

Expand Down

0 comments on commit 8666df6

Please sign in to comment.