debuglog 1.0.0 → 1.0.1
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.
- data/.gitignore +4 -0
- data/Gemfile +4 -0
- data/History.txt +8 -0
- data/LICENCE +19 -0
- data/README.txt +47 -0
- data/Rakefile +1 -0
- data/TODO.txt +11 -0
- data/debuglog.gemspec +29 -0
- data/doc/debuglog.markdown +278 -262
- data/etc/example.rb +24 -0
- data/lib/debuglog.rb +17 -17
- data/lib/debuglog/auto.rb +2 -2
- data/lib/debuglog/manual.rb +177 -177
- data/lib/debuglog/version.rb +3 -0
- data/test/_setup.rb +13 -14
- data/test/debuglog-auto.rb +79 -66
- data/test/debuglog-manual-1.rb +41 -39
- data/test/debuglog-manual-2.rb +29 -27
- metadata +62 -45
- data/README +0 -38
data/.gitignore
ADDED
data/Gemfile
ADDED
data/History.txt
ADDED
data/LICENCE
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
Copyright (c) 2005 Gavin Sinclair (gsinclair@gmail.com)
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
5
|
+
in the Software without restriction, including without limitation the rights
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
8
|
+
furnished to do so, subject to the following conditions:
|
9
|
+
|
10
|
+
The above copyright notice and this permission notice shall be included in
|
11
|
+
all copies or substantial portions of the Software.
|
12
|
+
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
+
THE SOFTWARE.
|
data/README.txt
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
debuglog: zero-conf debug.log file for simple and hassle-free debugging
|
2
|
+
|
3
|
+
|
4
|
+
= SYNOPSIS
|
5
|
+
|
6
|
+
Debuglog gives you debug, trace and time methods that write their output to the
|
7
|
+
file ./debug.log.
|
8
|
+
|
9
|
+
require 'debuglog' # or require 'debuglog/auto'
|
10
|
+
|
11
|
+
debug "Creating #{n} connections"
|
12
|
+
trace "names.first", binding
|
13
|
+
time('Process config file') { Subsystem.configure(ARGV.shift) }
|
14
|
+
|
15
|
+
The log file (default ./debug.log) will look something like this:
|
16
|
+
|
17
|
+
DebugLog -- 2011-12-28 18:58:22 +1000
|
18
|
+
-------------------------------------
|
19
|
+
[00.3] Creating 14 connections
|
20
|
+
[00.8] names.first == "Sandy White"
|
21
|
+
[01.9] Process config file: 1.0831 sec
|
22
|
+
|
23
|
+
The [00.3] etc. is the number of seconds (rounded) since the program started
|
24
|
+
(well, since require 'debuglog', anyway).
|
25
|
+
|
26
|
+
You can use different method names (to avoid a clash) and a different filename
|
27
|
+
with some initial configuration.
|
28
|
+
|
29
|
+
require 'debuglog/manual'
|
30
|
+
|
31
|
+
DebugLog.configure(
|
32
|
+
:debug => :my_debug,
|
33
|
+
:trace => :my_trace,
|
34
|
+
:time => :my_time,
|
35
|
+
:filename => 'log/xyz.log'
|
36
|
+
)
|
37
|
+
|
38
|
+
my_debug "Creating #{n} connections"
|
39
|
+
my_trace "names.first", binding
|
40
|
+
my_time('Process config file') { Subsystem.configure(ARGV.shift) }
|
41
|
+
|
42
|
+
|
43
|
+
= HOMEPAGE
|
44
|
+
|
45
|
+
See http://gsinclair.github.com/debuglog.html for full details.
|
46
|
+
|
47
|
+
MIT Licence
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/TODO.txt
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
* Get it working in 1.8.7
|
2
|
+
- one failing test at the moment
|
3
|
+
* See if it works in 1.8.6
|
4
|
+
- Whitestone doesn't work in 1.8.6 (and never will) so I can only test
|
5
|
+
it by tring it
|
6
|
+
|
7
|
+
|
8
|
+
Future features
|
9
|
+
|
10
|
+
* Colour, whether directly (:red, etc.) or indirectly (traces are yellow,
|
11
|
+
timings are cyan, strings with !! are red, ...)
|
data/debuglog.gemspec
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "debuglog/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "debuglog"
|
7
|
+
s.version = DebugLog::VERSION
|
8
|
+
s.authors = ["Gavin Sinclair"]
|
9
|
+
s.email = ["gsinclair@gmail.com"]
|
10
|
+
s.homepage = "http://gsinclair.github.com/debuglog.html"
|
11
|
+
s.summary = "Zero-conf debug.log file with 'debug', 'trace' and 'time' methods"
|
12
|
+
s.description = <<-EOF
|
13
|
+
require 'debuglog' and record debugging information (including variable traces
|
14
|
+
and timing information) to the file debug.log -- cheap and easy.
|
15
|
+
EOF
|
16
|
+
|
17
|
+
s.rubyforge_project = ""
|
18
|
+
s.has_rdoc = false
|
19
|
+
|
20
|
+
s.files = `git ls-files`.split("\n")
|
21
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
22
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
23
|
+
s.require_paths = ["lib"]
|
24
|
+
|
25
|
+
s.add_development_dependency "bundler"
|
26
|
+
s.add_development_dependency "whitestone"
|
27
|
+
|
28
|
+
s.required_ruby_version = '>= 1.8.6' # Tested.
|
29
|
+
end
|
data/doc/debuglog.markdown
CHANGED
@@ -1,262 +1,278 @@
|
|
1
|
-
---
|
2
|
-
layout: default
|
3
|
-
title: Debuglog
|
4
|
-
---
|
5
|
-
|
6
|
-
# Debuglog -- a zero-conf debug.log file
|
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
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
*
|
73
|
-
* the
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
following lines are equivalent:
|
92
|
-
|
93
|
-
{% highlight ruby %}
|
94
|
-
|
95
|
-
trace :radius, binding
|
96
|
-
debug "radius == #{radius.pretty_inspect}"
|
97
|
-
|
98
|
-
{% endhighlight %}
|
99
|
-
|
100
|
-
> Tip: You may choose to `alias _b binding` for convenience; DebugLog doesn't do that
|
101
|
-
> for you.
|
102
|
-
|
103
|
-
If you want the output truncated, pass an integer argument:
|
104
|
-
|
105
|
-
{% highlight ruby %}
|
106
|
-
|
107
|
-
trace :text, binding, 30
|
108
|
-
|
109
|
-
{% endhighlight %}
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
{
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
1
|
+
---
|
2
|
+
layout: default
|
3
|
+
title: Debuglog
|
4
|
+
---
|
5
|
+
|
6
|
+
# Debuglog -- a zero-conf debug.log file
|
7
|
+
|
8
|
+
* This will be replaced by a table of contents
|
9
|
+
{:toc}
|
10
|
+
|
11
|
+
|
12
|
+
## Synopsis
|
13
|
+
|
14
|
+
Debuglog gives you `debug`, `trace` and `time` methods that write their output
|
15
|
+
to the file `./debug.log`.
|
16
|
+
|
17
|
+
{% highlight ruby %}
|
18
|
+
|
19
|
+
require 'debuglog' # or require 'debuglog/auto'
|
20
|
+
|
21
|
+
debug "Creating #{n} connections"
|
22
|
+
trace "names.first", binding
|
23
|
+
time('Process config file') { Subsystem.configure(ARGV.shift) }
|
24
|
+
|
25
|
+
{% endhighlight %}
|
26
|
+
|
27
|
+
The log file (default `./debug.log`) will look something like this:
|
28
|
+
|
29
|
+
DebugLog -- 2011-12-28 18:58:22 +1000
|
30
|
+
-------------------------------------
|
31
|
+
[00.3] Creating 14 connections
|
32
|
+
[00.8] names.first == "Sandy White"
|
33
|
+
[01.9] Process config file: 1.0831 sec
|
34
|
+
|
35
|
+
The `[00.3]` etc. is the number of seconds (rounded) since the program started
|
36
|
+
(well, since `require 'debuglog'`, anyway).
|
37
|
+
|
38
|
+
You can use different method names (to avoid a clash) and a different filename
|
39
|
+
with some initial configuration.
|
40
|
+
|
41
|
+
{% highlight ruby %}
|
42
|
+
|
43
|
+
require 'debuglog/manual'
|
44
|
+
|
45
|
+
DebugLog.configure(
|
46
|
+
:debug => :my_debug,
|
47
|
+
:trace => :my_trace,
|
48
|
+
:time => :my_time,
|
49
|
+
:filename => 'log/xyz.log'
|
50
|
+
)
|
51
|
+
|
52
|
+
my_debug "Creating #{n} connections"
|
53
|
+
my_trace "names.first", binding
|
54
|
+
my_time('Process config file') { Subsystem.configure(ARGV.shift) }
|
55
|
+
|
56
|
+
{% endhighlight %}
|
57
|
+
|
58
|
+
More nuanced configuration is possible; see [Configuration](#Configuration).
|
59
|
+
|
60
|
+
### Installation
|
61
|
+
|
62
|
+
$ [sudo] gem install debuglog
|
63
|
+
|
64
|
+
Source code is hosted on Github. See [Project details](#project_details).
|
65
|
+
|
66
|
+
|
67
|
+
## Description
|
68
|
+
|
69
|
+
Debuglog allows you easy access to a log file named `debug.log` in the current
|
70
|
+
directory. In that file, you can record:
|
71
|
+
* arbitrary messages with `debug`
|
72
|
+
* the value of variables with `trace`
|
73
|
+
* the time taken to execute some code with `time`
|
74
|
+
|
75
|
+
Of course, any or all of those methods names might be used by another library or
|
76
|
+
by your own code. You can choose different method names and a different
|
77
|
+
filename; see [Configuration](#Configuration). Debuglog will raise an
|
78
|
+
exception (`DebugLog::Error`) if it detects a method clash.
|
79
|
+
|
80
|
+
### `debug`
|
81
|
+
|
82
|
+
The `debug` method is straightforward. It calls `to_s` on its argument(s) and
|
83
|
+
writes them to the log file.
|
84
|
+
|
85
|
+
[col]: http://gsinclair.github.com/col.html
|
86
|
+
|
87
|
+
### `trace`
|
88
|
+
|
89
|
+
`trace` emits the value of an expression. You are required to pass the binding with the `binding` method.
|
90
|
+
|
91
|
+
The two following lines are equivalent:
|
92
|
+
|
93
|
+
{% highlight ruby %}
|
94
|
+
|
95
|
+
trace :radius, binding
|
96
|
+
debug "radius == #{radius.pretty_inspect}"
|
97
|
+
|
98
|
+
{% endhighlight %}
|
99
|
+
|
100
|
+
> Tip: You may choose to `alias _b binding` for convenience; DebugLog doesn't do that
|
101
|
+
> for you.
|
102
|
+
|
103
|
+
If you want the output truncated, pass an integer argument:
|
104
|
+
|
105
|
+
{% highlight ruby %}
|
106
|
+
|
107
|
+
trace :text, binding, 30
|
108
|
+
|
109
|
+
{% endhighlight %}
|
110
|
+
|
111
|
+
The above examples use a symbol to trace a variable. You can, however, pass in
|
112
|
+
any expression:
|
113
|
+
|
114
|
+
{% highlight ruby %}
|
115
|
+
|
116
|
+
trace "names.find { |n| n.length > 7 }", binding
|
117
|
+
|
118
|
+
{% endhighlight %}
|
119
|
+
|
120
|
+
### `time`
|
121
|
+
|
122
|
+
`time` calculates the amount of time taken to execute the code in the block
|
123
|
+
given and records it in the log file.
|
124
|
+
|
125
|
+
{% highlight ruby %}
|
126
|
+
|
127
|
+
time("Process configuration file") { @options = parse_config }
|
128
|
+
|
129
|
+
{% endhighlight %}
|
130
|
+
|
131
|
+
It requires a single string (`#to_s`) argument and a block.
|
132
|
+
|
133
|
+
### Notes
|
134
|
+
|
135
|
+
`Debuglog` is a synonym for `DebugLog`, so you don't have to trouble yourself to
|
136
|
+
remember the capitalisation.
|
137
|
+
|
138
|
+
The text written to the log file has some nice touches:
|
139
|
+
* Multi-line output is indented correctly.
|
140
|
+
* `-------` is inserted each time an extra second of running time has elapsed.
|
141
|
+
This gives you a quick visual indication of how much logfile activity is
|
142
|
+
taking place. If more than one second has elapsed since the last log item,
|
143
|
+
something like `------- (3 sec)` is emitted.
|
144
|
+
|
145
|
+
|
146
|
+
## Configuration
|
147
|
+
|
148
|
+
The [Synopsis](#synopsis) gave a good example of configuration:
|
149
|
+
|
150
|
+
{% highlight ruby %}
|
151
|
+
|
152
|
+
require 'debuglog/manual'
|
153
|
+
|
154
|
+
DebugLog.configure(
|
155
|
+
:debug => :my_debug,
|
156
|
+
:trace => :my_trace,
|
157
|
+
:time => :my_time,
|
158
|
+
:filename => 'log/xyz.log'
|
159
|
+
)
|
160
|
+
|
161
|
+
{% endhighlight %}
|
162
|
+
|
163
|
+
This changes the names of the methods that Debuglog defines. The motivation for
|
164
|
+
that, of course, is to avoid a name clash with another library or your own code.
|
165
|
+
Debuglog will raise an exception (`DebugLog::Error`) if it detects a method name
|
166
|
+
clash. (Of course, you might load the other library _after_ Debuglog, in which
|
167
|
+
case it won't detect the clash.) This precaution is taken because they are
|
168
|
+
common method names at the top-level, and it's just not right for a debugging
|
169
|
+
library to _cause_ bugs.
|
170
|
+
|
171
|
+
If you omit a method name from the configuration, that method will not be
|
172
|
+
defined. The following code defines the method `d` instead of `debug`, but does
|
173
|
+
_not_ define `trace` or `time`. The standard filename `debug.log` is used.
|
174
|
+
|
175
|
+
{% highlight ruby %}
|
176
|
+
|
177
|
+
DebugLog.configure(
|
178
|
+
:debug => :d,
|
179
|
+
)
|
180
|
+
|
181
|
+
{% endhighlight %}
|
182
|
+
|
183
|
+
If you want to change one or two methods but leave the rest as standard, simply
|
184
|
+
do:
|
185
|
+
|
186
|
+
{% highlight ruby %}
|
187
|
+
|
188
|
+
DebugLog.configure(
|
189
|
+
:debug => :d,
|
190
|
+
:trace => :trace,
|
191
|
+
:time => :time
|
192
|
+
)
|
193
|
+
|
194
|
+
{% endhighlight %}
|
195
|
+
|
196
|
+
Once you have called `DebugLog.configure`, any further calls to it will be
|
197
|
+
ignored with a message on STDERR. That includes this case:
|
198
|
+
|
199
|
+
{% highlight ruby %}
|
200
|
+
|
201
|
+
require 'debuglog' # should be 'debuglog/manual'
|
202
|
+
|
203
|
+
DebugLog.configure(...)
|
204
|
+
|
205
|
+
{% endhighlight %}
|
206
|
+
|
207
|
+
The code `require 'debuglog'` is equivalent to the following code, meaning
|
208
|
+
your one shot at calling `configure` has been taken.
|
209
|
+
|
210
|
+
{% highlight ruby %}
|
211
|
+
|
212
|
+
require 'debuglog/manual'
|
213
|
+
|
214
|
+
DebugLog.configure(
|
215
|
+
:debug => :debug,
|
216
|
+
:trace => :trace,
|
217
|
+
:time => :time,
|
218
|
+
:file => 'debug.log'
|
219
|
+
)
|
220
|
+
|
221
|
+
{% endhighlight %}
|
222
|
+
|
223
|
+
Final note: if you specify a file that is not writable, an error
|
224
|
+
(`DebugLog::Error`) will be raised.
|
225
|
+
|
226
|
+
|
227
|
+
## Endnotes
|
228
|
+
|
229
|
+
### Motivation
|
230
|
+
|
231
|
+
Debugging to a log file is very useful, even if your program doesn't do
|
232
|
+
"logging" as such. Years ago I released `dev-utils/debug` which did this and
|
233
|
+
intended to do more. That's outdated now, only working on 1.8, so a revisit was
|
234
|
+
worthwhile with a better name. (If anyone wants the name `dev-utils` for
|
235
|
+
something else, they're welcome to it.)
|
236
|
+
|
237
|
+
### Dependencies and requirements
|
238
|
+
|
239
|
+
Debuglog does not depend on any other libraries. It is tested on Ruby versions
|
240
|
+
1.8.\[67] and 1.9.\[123]. It should continue to work on future 1.9 releases.
|
241
|
+
|
242
|
+
Unit tests are implemented in [Whitestone](http://gsinclair.github.com/whitestone.html).
|
243
|
+
|
244
|
+
### Project details
|
245
|
+
|
246
|
+
* Author: Gavin Sinclair (user name: `gsinclair`; mail server: `gmail.com`)
|
247
|
+
* Licence: MIT licence
|
248
|
+
* Project homepage: [http://gsinclair.github.com/debuglog.html][home]
|
249
|
+
* Source code: [http://github.com/gsinclair/debuglog][code]
|
250
|
+
* Documentation: (project homepage)
|
251
|
+
|
252
|
+
[home]: http://gsinclair.github.com/debuglog.html
|
253
|
+
[code]: http://github.com/gsinclair/debuglog
|
254
|
+
|
255
|
+
### History
|
256
|
+
|
257
|
+
* 6 JAN 2012: Version 1.0.1 released (improved documentation)
|
258
|
+
* 3 JAN 2012: Version 1.0.0 released but not announced
|
259
|
+
* JULY 2010: Implemented but not released
|
260
|
+
|
261
|
+
See History.txt for more details.
|
262
|
+
|
263
|
+
### Possible future enhancements
|
264
|
+
|
265
|
+
Color. For instance, `debug "!! Object pool overloaded"` could print the
|
266
|
+
message (minus the exclamation marks) in red. Traces could be in yellow. Times
|
267
|
+
could be in dark cyan, etc.
|
268
|
+
|
269
|
+
Further to the above: symbol arguments to `debug` could provide some color
|
270
|
+
using the `Col` library. E.g. `debug "blah...", :yb` for yellow bold.
|
271
|
+
|
272
|
+
Method to turn it off and on: `DebugLog.off` and `DebugLog.on` or something.
|
273
|
+
|
274
|
+
Indenting via `DebugLog.indent` and `DebugLog.outdent`.
|
275
|
+
|
276
|
+
Options for `trace` output: `p` for `:inspect`; `y` for `:to_yaml` etc. I
|
277
|
+
don't see why the current `:pretty_inspect` would ever be insufficient, but of
|
278
|
+
course there may be cases.
|