custom_log_generator 0.1.4 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 589992317b75137f7ba5f2278e39a60f48f36af17032d72ed6f6c8a3f55453dd
4
- data.tar.gz: 04c343f19f038fa0a2542803f57e42210745b220179ee53e42ddb7d4ca18605f
3
+ metadata.gz: 3d9c4ab8f8d586302435b54fa779e82ed367b613e88323c64d8aa711fe947527
4
+ data.tar.gz: 5d93a1824d6176cd87e4c46d0be78250f4523ce3af9bc85f0a89b726386b0d5f
5
5
  SHA512:
6
- metadata.gz: 0455aff79c9faeb7153a24d499fa354bdb04738a913d332b7b598b94c97d92fbeb7519d050960f14986d72737d36d1519e256b590f08baef9999c7a9980206f1
7
- data.tar.gz: c474e384756b2caec8037f6314d8cc1577c59d5ebcf4e116abf355e51faf498476ef0e2bd4cf13833199f922d5a9f0d69b49072ba10a6126bd8ec3d378ccc600
6
+ metadata.gz: a16e872438c000add76a07f187d5a9925078150c9a8da06ab54a8994429f74b2eeab751edb0c1d150f7e61d7bc5cd4eb99a529c22f6a355f6af4762e0b3d2878
7
+ data.tar.gz: f9990a13f9b94244df63d571f8802b0433634787139e165b3ca7618ada67968205a0f33914e5a76a05bee9437cd46470978832d09992cb7d2a8abce66e6de02b
data/README.md CHANGED
@@ -1,11 +1,15 @@
1
1
  # CustomLogGenerator
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/custom_log_generator`. 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
+ Sometimes, I want more logs to show me the process or some important informations generated by our application.
4
+ I tried to use default Logger to generate logs in default Rails logs. Then, you would be tired of finding your log in the massive default log file
5
+ Even though you can use tools like Logentries, but you may still think it's not convinent. B/C we may want to report the logs to someone by email.
6
+ If you're suffering from what I said above, I think "custom_log_generator" is the gem you want. You can define as many log files as you like in config file.
7
+ Then, for each file it will generate a custom logger for you. For details, please refer to #usage part.
6
8
 
7
9
  ## Installation
8
10
 
11
+ >This gem can only be used by combining with Rails project.
12
+
9
13
  Add this line to your application's Gemfile:
10
14
 
11
15
  ```ruby
@@ -16,13 +20,19 @@ And then execute:
16
20
 
17
21
  $ bundle
18
22
 
19
- Or install it yourself as:
23
+ ## Usage
24
+
25
+ After you finished the installation by bundle.
26
+ You need to run:
20
27
 
21
- $ gem install custom_log_generator
28
+ $ rake custom_log:install
22
29
 
23
- ## Usage
30
+ After doing this, you will get two file:
31
+
32
+ - config/custom_logs.yml
33
+ - config/initializers/generate_custom_logger.rb
24
34
 
25
- TODO: Write usage instructions here
35
+ Then, you need to declare the logs you want in the config file "custom_logs.yml"
26
36
 
27
37
  ## Development
28
38
 
@@ -8,3 +8,8 @@
8
8
  #
9
9
  # - 'log/error.log'
10
10
  # - 'log/order.log'
11
+ #
12
+ # then, you can use the logger in your code like:
13
+ #
14
+ # ORDER_LOGGER.info "Hey, I will be recorded into order.log"
15
+ # ERROR_LOGGER.info "Hi ORDER, I'm your brother, I will be recorded into error.log"
@@ -1,3 +1,3 @@
1
1
  module CustomLogGenerator
2
- VERSION = "0.1.4"
2
+ VERSION = "1.0.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: custom_log_generator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hiveer Li