nanolog 0.1.0 → 0.1.1b
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +46 -0
- data/lib/nanolog.rb +4 -3
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb8f1f3bcfb8ed4cac6c1c2634151f370512bc40
|
4
|
+
data.tar.gz: abfb771b6b8b32fc3c2c7ff398d0d7040ce43097
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c871f69def49d9cf688a2496ab07bc23112548c29c12331be3cccd5803243cd6c127e8cdc3500f7571556e7dc3bfd88aa34ee83bef4f40b0d129e0ad90ba5d62
|
7
|
+
data.tar.gz: e4c3574555ecd69216867a95cf026757237112ed4c33003fb46fedb8b3c70ae430c51e021d4fdf9b5f257b1a702e2ab7ce7494d13fe1e46257bfb252b8a9f67b
|
data/README.md
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
# NanoLog [![Gem Version](https://badge.fury.io/rb/nanolog.svg)](https://badge.fury.io/rb/nanolog)
|
2
|
+
A simple and extremely small logging library for Ruby.
|
3
|
+
|
4
|
+
## Getting Started
|
5
|
+
|
6
|
+
A simple program using NanoLog looks like so:
|
7
|
+
|
8
|
+
```ruby
|
9
|
+
logger = NanoLog::Logger.new('filepath.log')
|
10
|
+
|
11
|
+
logger.info('informational message')
|
12
|
+
logger.fatal('fatal message')
|
13
|
+
```
|
14
|
+
|
15
|
+
## Installing
|
16
|
+
Install the gem like so:
|
17
|
+
|
18
|
+
`gem install nanolog`
|
19
|
+
|
20
|
+
or add the following line to your `Gemfile`:
|
21
|
+
|
22
|
+
`gem 'nanolog', '~> 0.1.1'`
|
23
|
+
|
24
|
+
## Documentation
|
25
|
+
Available [here](http://www.rubydoc.info/gems/nanolog/0.1.1)
|
26
|
+
|
27
|
+
## Authors
|
28
|
+
- Carter Brainerd (cbrnrd) - [GitHub](https://github.com/cbrnrd)
|
29
|
+
|
30
|
+
## Legal stuff
|
31
|
+
NanoLog is licensed under the MIT license (see [LICENSE](https://github.com/cbrnrd/ruby-NanoLog/blob/master/LICENSE))
|
32
|
+
|
33
|
+
## Built with
|
34
|
+
* [Atom](http://atom.io)
|
35
|
+
|
36
|
+
## Thank you
|
37
|
+
|
38
|
+
Thank you for using NanoLog 👏.
|
39
|
+
If you're feeling generous, donations are always appreciated:
|
40
|
+
|
41
|
+
```
|
42
|
+
19XiyrvqyYNLehf89ckBjPQYCfW77F9rx7 (Ƀ, BTC)
|
43
|
+
0xf6f247e4a929890926F88144111f5E27d87bD07a (ETH)
|
44
|
+
LQRUJUpSkmi5BfT6nyPVNKKoLWbnpZ64sL (Ł, LTC)
|
45
|
+
https://www.paypal.me/0xCB (PayPal)
|
46
|
+
```
|
data/lib/nanolog.rb
CHANGED
@@ -4,7 +4,6 @@ module NanoLog
|
|
4
4
|
|
5
5
|
@logfile = nil
|
6
6
|
|
7
|
-
# Log message builder strings
|
8
7
|
INFO = ' [INFO] '
|
9
8
|
DEBUG = ' [DEBUG] '
|
10
9
|
FATAL = ' [FATAL] '
|
@@ -13,10 +12,12 @@ module NanoLog
|
|
13
12
|
|
14
13
|
#
|
15
14
|
# @param path [String] the path to save the logfile at
|
15
|
+
# @param flush [boolean] whether or not to flush the previous file (if it already exists)
|
16
16
|
#
|
17
|
-
def initialize(path)
|
17
|
+
def initialize(path, flush=false)
|
18
18
|
raise NanoLog::NilPathError unless !path.nil?
|
19
|
-
@logfile = File.new(path, 'a')
|
19
|
+
@logfile = File.new(path, 'a') unless flush
|
20
|
+
@logfile = File.new(path, 'w+') if flush
|
20
21
|
end
|
21
22
|
|
22
23
|
#
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nanolog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1b
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carter Brainerd
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-07-
|
11
|
+
date: 2017-07-12 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: cbawsome77@gmail.com
|
@@ -16,6 +16,7 @@ executables: []
|
|
16
16
|
extensions: []
|
17
17
|
extra_rdoc_files: []
|
18
18
|
files:
|
19
|
+
- README.md
|
19
20
|
- lib/nanolog.rb
|
20
21
|
homepage: http://rubygems.org/gems/nanolog
|
21
22
|
licenses:
|
@@ -32,9 +33,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
32
33
|
version: '0'
|
33
34
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
34
35
|
requirements:
|
35
|
-
- - "
|
36
|
+
- - ">"
|
36
37
|
- !ruby/object:Gem::Version
|
37
|
-
version:
|
38
|
+
version: 1.3.1
|
38
39
|
requirements: []
|
39
40
|
rubyforge_project:
|
40
41
|
rubygems_version: 2.5.2
|