shlog 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/shlog/cli.rb +0 -1
- data/lib/shlog/commands/log.rb +10 -0
- data/shlog.gemspec +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3569902cd0691379120f1a44391aa1c0201c9272
|
4
|
+
data.tar.gz: 05dca400889c8e220a90863dcd03aab03dde242b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f10dd1a17fb6191b6891cec85f4d296923d3500a2701c0566856d79055a7f5aaf2e0c40ee155f8a60b00bd762818dbb3c3c4e4cce57a2de0de2f2b1952c5275
|
7
|
+
data.tar.gz: 0242928b1cccedbdfd35056fe62a1219310ecca16a276b4331b4cd2a55b3fa05c6895f590836da132944b86181d778c45118b47b2a0a79ce540178a81f87d10b
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.3
|
data/lib/shlog/cli.rb
CHANGED
data/lib/shlog/commands/log.rb
CHANGED
@@ -48,6 +48,9 @@ module Shlog
|
|
48
48
|
c.desc "Vebose mode"
|
49
49
|
c.switch :v, :verbose, default: false
|
50
50
|
|
51
|
+
c.desc "Archive current log file"
|
52
|
+
c.switch :archive, default: false, negatable: false
|
53
|
+
|
51
54
|
c.desc "Get the path to the log file"
|
52
55
|
c.switch :g, :"get-logfile", default: false, negatable: false
|
53
56
|
|
@@ -58,6 +61,13 @@ module Shlog
|
|
58
61
|
# NOTE: All the options are ignored when the '--get-logfile' options is passed
|
59
62
|
|
60
63
|
puts file
|
64
|
+
elsif options[:archive]
|
65
|
+
if File.open(file, "r").lstat.size == 0
|
66
|
+
raise RuntimeError, "The log file is empty and cannot be archived"
|
67
|
+
end
|
68
|
+
|
69
|
+
logger = Lumberjack::Device::SizeRollingLogFile.new(file, manual: true)
|
70
|
+
logger.roll_file!
|
61
71
|
else
|
62
72
|
if args.empty?
|
63
73
|
raise ArgumentError, "Cannot add a log entry without a message"
|
data/shlog.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shlog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aziz Light
|
@@ -81,19 +81,19 @@ dependencies:
|
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
84
|
+
name: lumberjack_aziz_light
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - '
|
87
|
+
- - '='
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
89
|
+
version: 1.0.6
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - '
|
94
|
+
- - '='
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
96
|
+
version: 1.0.6
|
97
97
|
description: A wrapper around lumberjack (https://github.com/bdurand/lumberjack) to
|
98
98
|
make logging on the command line easier.
|
99
99
|
email:
|