sr_log 0.1.1 → 1.0.0

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.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/README.md +10 -11
  4. data/lib/sr_log/version.rb +1 -1
  5. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1466e960b28cf99511139bf5f9c2305fd8b3b804
4
- data.tar.gz: aefdd526b4ada8a77cf2e089601086b133a8fbe5
3
+ metadata.gz: 5db7707c0a77a5d4bac7ed154ebd05f6bd1983df
4
+ data.tar.gz: 4f7060824e0dd840c9e9f2d0e8bb5c589c27be41
5
5
  SHA512:
6
- metadata.gz: 80c1f636473ce50dab0fab67b9a85c9a6a273e2da049f799532ff23b2828fb83a20f0a2e4858b66d716c483dbc8a82a97091f62a5d7114a1e90d34c779ed72dc
7
- data.tar.gz: 20599ffb7a856e227dbc372e2c26e4e443fe42ec8294f8d89374522c8c13f150ae953f1228dbbbe6064a9468d23dbd232e2edc1d140631f0bc1d80366cc32afd
6
+ metadata.gz: 4b8f8e4dadbfc0b5908e8f601ffc8dd179c1e6bb9c66300014d20f009f9fc8ec6fd2c6c95c9a750e6fed77ffffc1e9881bf4aa86d0f3358c498baffd9934cc61
7
+ data.tar.gz: 72fb5b9b1bd642f38dde09c3f344a455cfb870a9bfd0daa7f59ab13bbf6a3514a177e6d81dd37a6b9aace7d6b625893e9716dc033ff8013250b8c3e7c70bbe1a
data/.gitignore CHANGED
@@ -6,4 +6,5 @@
6
6
  /doc/
7
7
  /pkg/
8
8
  /spec/reports/
9
+ /spec/test_logs/
9
10
  /tmp/
data/README.md CHANGED
@@ -1,8 +1,6 @@
1
- # SrLog
1
+ # sr_log
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/sr_log`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
3
+ **sr_log** is a simple wrapper method around ruby's native `Logger` class. It allows you to write to multiple custom logfiles and serves the purpose of log rotation by prefixing the logfiles with a month stamp.
6
4
 
7
5
  ## Installation
8
6
 
@@ -22,20 +20,21 @@ Or install it yourself as:
22
20
 
23
21
  ## Usage
24
22
 
25
- TODO: Write usage instructions here
23
+ To write to a logfile, call the global `sr_log` method. For example:
26
24
 
27
- ## Development
25
+ ```ruby
26
+ sr_log :user_updates, "This is my message"
27
+ ```
28
28
 
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
29
+ `sr_log` will create a `./log/2016_12_user_updates.log` file if one does not already exist (except that it will use current year/month for the prefix). Then it will write the line "This is my message" to the logfile after a timestamp.
30
30
 
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
31
+ Optionally you can pass named arguments to the `sr_log` method:
32
32
 
33
- ## Contributing
33
+ Argument: `:dir`, type: `string`. Use `:dir` to set a custom path for where the logfile is saved.
34
34
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/sr_log.
35
+ Argument: `:current_user`, type: `Object`. Use `:current_user` to specify that the message is being logged by a use. This will add a `"Logged by user: #{current_user}"` line after the timestamp in the logfile.
36
36
 
37
37
 
38
38
  ## License
39
39
 
40
40
  The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
41
-
@@ -1,3 +1,3 @@
1
1
  module SrLog
2
- VERSION = '0.1.1'
2
+ VERSION = '1.0.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sr_log
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Huber