blob: fe8e5acd65126b0e36c6a01b763d85b9ce619df5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
module LeapCli
def self.log_level
@log_level
end
def self.log_level=(value)
@log_level = value
end
end
def log0(message=nil, &block)
if message
puts message
elsif block
puts yield(block)
end
end
def log1(message=nil, &block)
if LeapCli.log_level > 0
if message
puts message
elsif block
puts yield(block)
end
end
end
def log2(message=nil, &block)
if LeapCli.log_level > 1
if message
puts message
elsif block
puts yield(block)
end
end
end
def help!(message=nil)
ENV['GLI_DEBUG'] = "false"
help_now!(message)
end
def fail!(message=nil)
ENV['GLI_DEBUG'] = "false"
exit_now!(message)
end
|