log4ever 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -50,6 +50,8 @@ Add dependency gem.
50
50
  Bug fix.
51
51
  * 0.0.6
52
52
  Bug fix.
53
+ * 0.0.7
54
+ Bug fix.
53
55
 
54
56
  ##License
55
57
  Licensed under the MIT
@@ -15,7 +15,7 @@ require "Evernote/EDAM/note_store"
15
15
  require "Evernote/EDAM/limits_constants.rb"
16
16
 
17
17
  module Log4ever
18
- VERSION = '0.0.6'
18
+ VERSION = '0.0.7'
19
19
  class TypeError < StandardError; end
20
20
  module ShiftAge
21
21
  DAILY = 1
@@ -15,6 +15,13 @@ module Log4r
15
15
  super(_name, hash)
16
16
  validate(hash)
17
17
  end
18
+
19
+ # synchronize note
20
+ def sync
21
+ @note = @evernote.get_note(@notebook)
22
+ set_maxsize(@hash) # for rolling
23
+ set_shift_age(@hash) # for rolling
24
+ end
18
25
 
19
26
  # validation of evernote parameters
20
27
  def validate(hash)
@@ -33,17 +40,17 @@ module Log4r
33
40
  stack_name = hash[:stack] || hash['stack']
34
41
  @evernote = MyEvernote.new(@env, @auth_token)
35
42
  tags = @evernote.get_tags(hash[:tags] || hash['tags'] || [])
36
- notebook = @evernote.get_notebook(notebook_name, stack_name)
37
- @note = @evernote.get_note(notebook)
38
43
  @tags = tags.map{|tag_obj| tag_obj.guid}
39
- set_maxsize(hash) # for rolling
40
- set_shift_age(hash) # for rolling
44
+ @notebook = @evernote.get_notebook(notebook_name, stack_name)
45
+ @hash = hash
46
+ sync
41
47
  end
42
48
 
43
49
  def canonical_log(logevent); super end
44
50
 
45
51
  # write log
46
52
  def write(content)
53
+ sync
47
54
  if note_size_requires_roll? || time_requires_roll?
48
55
  create_log(content)
49
56
  else
data/log4ever.gemspec CHANGED
@@ -11,6 +11,6 @@ Gem::Specification.new do |gem|
11
11
  gem.name = "log4ever"
12
12
  gem.require_paths = ["lib"]
13
13
  gem.add_dependency('log4r', '>= 1.1.10')
14
- gem.version = '0.0.6'
14
+ gem.version = '0.0.7'
15
15
  end
16
16
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: log4ever
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,12 +9,12 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-15 00:00:00.000000000 +09:00
12
+ date: 2012-10-16 00:00:00.000000000 +09:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: log4r
17
- requirement: &2156843060 !ruby/object:Gem::Requirement
17
+ requirement: &2156644240 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,7 +22,7 @@ dependencies:
22
22
  version: 1.1.10
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *2156843060
25
+ version_requirements: *2156644240
26
26
  description: log4ever is simple logger for evernote. It is available as an extension
27
27
  of log4r.
28
28
  email: