rubyang 0.1.1 → 0.1.2

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.
@@ -14,6 +14,16 @@ module Rubyang
14
14
  @data_tree = DataTree.new @schema_tree
15
15
  end
16
16
 
17
+ def to_s parent=true
18
+ head, vars, tail = "#<#{self.class.to_s}:0x#{(self.object_id << 1).to_s(16).rjust(14,'0')} ", Array.new, ">"
19
+ if parent
20
+ vars.push "@yangs=#{@yangs.to_s}"
21
+ vars.push "@schema_tree=#{@schema_tree.to_s( false )}"
22
+ vars.push "@data_tree=#{@data_tree.to_s( false )}"
23
+ end
24
+ head + vars.join(', ') + tail
25
+ end
26
+
17
27
  def load_model model
18
28
  @schema_tree.load model
19
29
  end
@@ -0,0 +1,19 @@
1
+ # coding: utf-8
2
+
3
+ require 'logger'
4
+ require 'singleton'
5
+
6
+ module Rubyang
7
+ class Logger
8
+ include Singleton
9
+
10
+ def initialize
11
+ @logger = ::Logger.new STDOUT
12
+ @logger.level = ::Logger::DEBUG
13
+ end
14
+
15
+ def method_missing method, *arg
16
+ @logger.send method, *arg
17
+ end
18
+ end
19
+ end