debugtrace 0.3.0 → 1.0.0
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.
- checksums.yaml +4 -4
- data/README.md +568 -16
- data/README_ja.md +590 -0
- data/examples/debugtrace.yml +28 -0
- data/examples/readme-example.rb +36 -0
- data/lib/debugtrace/config.rb +31 -33
- data/lib/debugtrace/log_buffer.rb +5 -8
- data/lib/debugtrace/loggers.rb +7 -7
- data/lib/debugtrace/version.rb +1 -1
- data/lib/debugtrace.rb +118 -88
- metadata +6 -4
- data/debugtrace.yml +0 -2
- /data/{LICENSE → LICENSE.txt} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 007becfaaebee62ef14be62da8bcff6530fd2ca3835c09e153254f9699b1ac7b
|
4
|
+
data.tar.gz: 4bb241654f775b6891bc95234dad0b24f4caf0a770e56488521c10ce26e9d818
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd547264f234ca06406199fb09ea1e689366c5096e62565f1926b96a1f888ec15322f145991deb155ef0dd61f6fff96aedfa246bc6a3fe6f69e297ea93bda06d
|
7
|
+
data.tar.gz: 6a0b7a8f3026dab44469ec6c5ab2bd2b1cace79e855dfc5165a2d35445ce4e2484d36283d5cf9d3a3e1bc99e17aff0b8e2d3ebc452683007ef76f397f79add11
|
data/README.md
CHANGED
@@ -1,40 +1,592 @@
|
|
1
1
|
# DebugTrace-rb
|
2
|
-
A Ruby library to output logs for debugging.
|
3
2
|
|
4
|
-
|
3
|
+
[Japanese](README_ja.md)
|
5
4
|
|
6
|
-
|
5
|
+
**DebugTrace-rb** is a library that outputs trace logs when debugging Ruby, and is available for Ruby 3.1.0 and later.
|
6
|
+
By embedding `DebugTrace.enter` and `DebugTrace.leave` at the start and end of a method, you can output the execution status of a Ruby program you are developing.
|
7
7
|
|
8
|
-
|
8
|
+
## 1. Features
|
9
9
|
|
10
|
-
|
10
|
+
* Automatically outputs the calling method name, source file name, and line number.
|
11
|
+
* Automatically indents logs when nesting methods or objects.
|
12
|
+
* Automatically inserts line breaks when outputting values.
|
13
|
+
* Can output object contents using reflection.
|
14
|
+
* Output contents can be customized by configuring the `debugtrace.yml` file.
|
11
15
|
|
12
|
-
|
16
|
+
## 2. Installation
|
17
|
+
|
18
|
+
Run the following command to install the gem and add it to your application's Gemfile:
|
13
19
|
|
14
20
|
```bash
|
15
21
|
$ bundle add debugtrace
|
16
22
|
```
|
17
23
|
|
18
|
-
If
|
24
|
+
If you are not using bundler to manage dependencies, run the following command to install the gem:
|
19
25
|
|
20
26
|
```bash
|
21
27
|
$ gem install debugtrace
|
22
28
|
```
|
23
29
|
|
24
|
-
## Usage
|
30
|
+
## 3. Usage
|
31
|
+
|
32
|
+
Do the following for the debug target and related methods.
|
33
|
+
|
34
|
+
1. Insert `DebugTrace.enter` at the beginning of the method.
|
35
|
+
|
36
|
+
1. Insert `DebugTrace.leave` at the end of the method (or just before the `return` statement).
|
37
|
+
|
38
|
+
1. Optionally, insert `DebugTrace.print('foo', foo)` to print arguments, local variables, and return values to the log.
|
39
|
+
|
40
|
+
Below is an example of Ruby using DebugTrace-rb methods and the log when it is executed.
|
41
|
+
|
42
|
+
```ruby
|
43
|
+
# frozen_string_literal: true
|
44
|
+
# readme-example.rb
|
45
|
+
require 'debugtrace'
|
46
|
+
|
47
|
+
class Contact
|
48
|
+
attr_reader :id, :firstName, :lastName, :birthday
|
49
|
+
|
50
|
+
def initialize(id, firstName, lastName, birthday)
|
51
|
+
DebugTrace.enter
|
52
|
+
@id = id
|
53
|
+
@firstName = firstName
|
54
|
+
@lastName = lastName
|
55
|
+
@birthday = birthday
|
56
|
+
DebugTrace.leave
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
def func2
|
61
|
+
DebugTrace.enter
|
62
|
+
contacts = [
|
63
|
+
Contact.new(1, 'Akane' , 'Apple', Date.new(1991, 2, 3)),
|
64
|
+
Contact.new(2, 'Yukari', 'Apple', Date.new(1992, 3, 4))
|
65
|
+
]
|
66
|
+
DebugTrace.print('contacts', contacts)
|
67
|
+
DebugTrace.leave
|
68
|
+
end
|
69
|
+
|
70
|
+
def func1
|
71
|
+
DebugTrace.enter
|
72
|
+
DebugTrace.print('Hello, World!')
|
73
|
+
func2
|
74
|
+
DebugTrace.leave
|
75
|
+
end
|
76
|
+
|
77
|
+
func1
|
78
|
+
```
|
79
|
+
|
80
|
+
```log
|
81
|
+
2025-05-17 20:38:04.084+09:00 DebugTrace-rb 1.0.0 on Ruby 3.4.4
|
82
|
+
2025-05-17 20:38:04.084+09:00 config file: <No config file>
|
83
|
+
2025-05-17 20:38:04.084+09:00 logger: StdErrLogger
|
84
|
+
2025-05-17 20:38:04.084+09:00
|
85
|
+
2025-05-17 20:38:04.084+09:00 ______________________________ #72 ______________________________
|
86
|
+
2025-05-17 20:38:04.084+09:00
|
87
|
+
2025-05-17 20:38:04.085+09:00 Enter func1 (readme-example.rb:30) <- <main> (readme-example.rb:36)
|
88
|
+
2025-05-17 20:38:04.085+09:00 | Hello, World! (readme-example.rb:31)
|
89
|
+
2025-05-17 20:38:04.085+09:00 | Enter func2 (readme-example.rb:20) <- func1 (readme-example.rb:32)
|
90
|
+
2025-05-17 20:38:04.085+09:00 | | Enter initialize (readme-example.rb:10) <- new (readme-example.rb:22)
|
91
|
+
2025-05-17 20:38:04.085+09:00 | | Leave initialize (readme-example.rb:15) duration: 0.015 ms
|
92
|
+
2025-05-17 20:38:04.085+09:00 | |
|
93
|
+
2025-05-17 20:38:04.085+09:00 | | Enter initialize (readme-example.rb:10) <- new (readme-example.rb:23)
|
94
|
+
2025-05-17 20:38:04.085+09:00 | | Leave initialize (readme-example.rb:15) duration: 0.010 ms
|
95
|
+
2025-05-17 20:38:04.085+09:00 | |
|
96
|
+
2025-05-17 20:38:04.085+09:00 | | contacts = [
|
97
|
+
2025-05-17 20:38:04.085+09:00 | | Contact{
|
98
|
+
2025-05-17 20:38:04.085+09:00 | | @id: 1, @firstName: 'Akane', @lastName: 'Apple', @birthday: 1991-02-03
|
99
|
+
2025-05-17 20:38:04.085+09:00 | | },
|
100
|
+
2025-05-17 20:38:04.085+09:00 | | Contact{
|
101
|
+
2025-05-17 20:38:04.085+09:00 | | @id: 2, @firstName: 'Yukari', @lastName: 'Apple', @birthday: 1992-03-04
|
102
|
+
2025-05-17 20:38:04.085+09:00 | | }
|
103
|
+
2025-05-17 20:38:04.085+09:00 | | ] (readme-example.rb:25)
|
104
|
+
2025-05-17 20:38:04.085+09:00 | |
|
105
|
+
2025-05-17 20:38:04.085+09:00 | Leave func2 (readme-example.rb:26) duration: 0.789 ms
|
106
|
+
2025-05-17 20:38:04.085+09:00 Leave func1 (readme-example.rb:33) duration: 0.937 ms
|
107
|
+
```
|
108
|
+
|
109
|
+
### 4. List of methods
|
110
|
+
|
111
|
+
DebugTrace module has the following methods.
|
25
112
|
|
26
|
-
|
113
|
+
<table>
|
114
|
+
<caption>Method List</caption>
|
115
|
+
<tr>
|
116
|
+
<th style="text-align:center">Method name</th>
|
117
|
+
<th style="text-align:center">Arguments</th>
|
118
|
+
<th style="text-align:center">Return value</th>
|
119
|
+
<th style="text-align:center">Description</th>
|
120
|
+
</tr>
|
121
|
+
<tr>
|
122
|
+
<td><code>enter</code></td>
|
123
|
+
<td><i>None</i></td>
|
124
|
+
<td><i>None</i></td>
|
125
|
+
<td>Outputs the start of the method to the log.</td>
|
126
|
+
</tr>
|
127
|
+
<tr>
|
128
|
+
<td><code>leave</code></td>
|
129
|
+
<td><code>return_value</code>: return value of this method<small>(Optional)</small></td>
|
130
|
+
<td><code>return_value</code> <small>(<code>nil</code> if <code>return_value</code> is omitted)</small></td>
|
131
|
+
<td>Output the end of the method to the log.</td>
|
132
|
+
</tr>
|
133
|
+
<tr>
|
134
|
+
<td><code>print</code></td>
|
135
|
+
<td>
|
136
|
+
<code>name</code>: the value name<br>
|
137
|
+
<code>value</code>: the value <small>(Optional)</small><br>
|
138
|
+
<small><i>The following arguments are keyword arguments and optional</i></small><br>
|
139
|
+
<code>reflection</code>: reflection is used aggressively if <code>true</code>, used passively if <code>false</code><small>(Default: <code>false</code>)</small><br>
|
140
|
+
<small><i>The following arguments can be specified in debugtrace.yml (argument specification takes precedence)</i></small><br>
|
141
|
+
<code>minimum_output_size</code>: The minimum number of elements to print for <code>Array</code>, <code>Hash</code> and <code>Set</code><br>
|
142
|
+
<code>minimum_output_length</code>: The minimum length to print the length of the string<br>
|
143
|
+
<code>collection_limit</code>: The limit on the number of elements output for <code>Map</code>, <code>Hash</code> and <code>Set</code><br>
|
144
|
+
<code>string_limit</code>: The limit on the number of characters that can be output from a string<br>
|
145
|
+
<code>reflection_limit</code>: The limit of reflection nesting<br>
|
146
|
+
</td>
|
147
|
+
<td>the argument value if it is specified, otherwise <code>nil</code></td>
|
148
|
+
<td>
|
149
|
+
If the value is specified, it will be output to the log in the format:<br>
|
150
|
+
<code><value name> = <value></code> <br>
|
151
|
+
, otherwise prints <code>name</code> as a message.
|
152
|
+
</td>
|
153
|
+
</tr>
|
154
|
+
</table>
|
27
155
|
|
28
|
-
|
156
|
+
### 5. debugtrace.yml Properties
|
29
157
|
|
30
|
-
|
158
|
+
You can specify the path of debugtrace.yml with the environment variable `DEBUGTRACE_CONFIG`.
|
159
|
+
The default path is `./debugtrace.yml`.
|
160
|
+
You can specify the following properties in debugtrace.yml.
|
31
161
|
|
32
|
-
|
162
|
+
<table>
|
163
|
+
<caption>debugtrace.yml</caption>
|
164
|
+
<tr>
|
165
|
+
<th style="text-align:center">Property Name</th>
|
166
|
+
<th style="text-align:center">Description</th>
|
167
|
+
</tr>
|
168
|
+
<tr>
|
169
|
+
<td><code>logger</code></td>
|
170
|
+
<td>
|
171
|
+
Specifying the log output destination<br>
|
172
|
+
<small><b>Examples:</b></small>
|
173
|
+
<ul>
|
174
|
+
<code>logger: stdout</code> - <small>standard output</small><br>
|
175
|
+
<code>logger: stderr</code> - <small>standard error output</small><br>
|
176
|
+
<code>logger: rubylogger</code> - <small>use the Ruby Logger class</small><br>
|
177
|
+
<code>logger: file</code> - <small>specified file</small>
|
178
|
+
</ul>
|
179
|
+
<small><b>Default Value:</b></small>
|
180
|
+
<ul>
|
181
|
+
<code>stderr</code>
|
182
|
+
</ul>
|
183
|
+
</td>
|
184
|
+
</tr>
|
185
|
+
<tr>
|
186
|
+
<td><code>log_path</code></td>
|
187
|
+
<td>
|
188
|
+
Path to log output destination when using <code>rubylogger</code> or <code>file</code><br>
|
189
|
+
If the first character is <code>+</code> and using <code>logger: file</code>, the log will be appended.<br>
|
190
|
+
<small><b>Example:</b></small>
|
191
|
+
<ul>
|
192
|
+
<code>logger: file</code><br>
|
193
|
+
<code>log_path: +/var/log/debugtrace.log</code><br>
|
194
|
+
</ul>
|
195
|
+
<small><b>Default Value:</b></small>
|
196
|
+
<ul>
|
197
|
+
<code>debugtrace.log</code>
|
198
|
+
</ul>
|
199
|
+
</td>
|
200
|
+
</tr>
|
201
|
+
<tr>
|
202
|
+
<td><code>rubylogger_format</code></td>
|
203
|
+
<td>
|
204
|
+
The format string when using the Ruby <code>Logger</code> class<br>
|
205
|
+
<small><b>Example:</b></small>
|
206
|
+
<ul>
|
207
|
+
<code>rubylogger_format: "%2$s %1$s %3$s %4$s\n"</code>
|
208
|
+
</ul>
|
209
|
+
<small><b>Parameters:</b></small><br>
|
210
|
+
<ul>
|
211
|
+
<code>%1</code>: the log level <small>(DEBUG)</small><br>
|
212
|
+
<code>%2</code>: the date<br>
|
213
|
+
<code>%3</code>: the program <small>(DebugTrace)</small><br>
|
214
|
+
<code>%4</code>: the message
|
215
|
+
</ul>
|
216
|
+
<small><b>Default Value:</b></small>
|
217
|
+
<ul>
|
218
|
+
<code>rubylogger_format: "%2$s %1$s %4$s\n"</code>
|
219
|
+
</ul>
|
220
|
+
<small><b>Reference:</b></small><br>
|
221
|
+
<ul>
|
222
|
+
<code><a href="https://docs.ruby-lang.org/ja/latest/class/Logger.html">class Logger</code>
|
223
|
+
</ul>
|
224
|
+
</td>
|
225
|
+
</tr>
|
226
|
+
<tr>
|
227
|
+
<td><code>log_datetime_format</code></td>
|
228
|
+
<td>
|
229
|
+
Log date and time format<br>
|
230
|
+
<small><b>Example:</b></small>
|
231
|
+
<ul>
|
232
|
+
<code>log_datetime_format: "%Y/%m/%d %H:%M:%S.%L%"</code>
|
233
|
+
</ul>
|
234
|
+
<small><b>Default Value:</b></small>
|
235
|
+
<ul>
|
236
|
+
<code>log_datetime_format: "%Y-%m-%d %H:%M:%S.%L%:z"</code>
|
237
|
+
</ul>
|
238
|
+
<small><b>Reference:</b></small><br>
|
239
|
+
<ul>
|
240
|
+
<code><a href="https://docs.ruby-lang.org/ja/latest/method/Date/s/_strptime.html">Date._strptime</code>
|
241
|
+
</ul>
|
242
|
+
</td>
|
243
|
+
</tr>
|
244
|
+
<tr>
|
245
|
+
<td><code>enabled</code></td>
|
246
|
+
<td>
|
247
|
+
Enables logging if <code>true</code>,disables logging if <code>false</code><br>
|
248
|
+
<small><b>Example:</b></small>
|
249
|
+
<ul>
|
250
|
+
<code>enabled: false</code>
|
251
|
+
</ul>
|
252
|
+
<small><b>Default Value:</b></small>
|
253
|
+
<ul>
|
254
|
+
<code>enabled: true</code>
|
255
|
+
</ul>
|
256
|
+
</td>
|
257
|
+
</tr>
|
258
|
+
<tr>
|
259
|
+
<td><code>enter_format</code></td>
|
260
|
+
<td>
|
261
|
+
The log format to be output at the start of methods<br>
|
262
|
+
<small><b>Example:</b></small>
|
263
|
+
<ul>
|
264
|
+
<code>enter_format: "┌ %1$s (%2$s:%3$d)"</code>
|
265
|
+
</ul>
|
266
|
+
<small><b>Parameters:</b></small><br>
|
267
|
+
<ul>
|
268
|
+
<code>%1</code>: the method name<br>
|
269
|
+
<code>%2</code>: the file name<br>
|
270
|
+
<code>%3</code>: the line number<br>
|
271
|
+
<code>%4</code>: the method name of the calling method<br>
|
272
|
+
<code>%5</code>: the file name of the calling method<br>
|
273
|
+
<code>%6</code>: the line number of the calling method
|
274
|
+
</ul>
|
275
|
+
<small><b>Default Value:</b></small>
|
276
|
+
<ul>
|
277
|
+
<code>enter_format: "Enter %1$s (%2$s:%3$d) <- %4$s (%5$s:%6$d)"</code>
|
278
|
+
</ul>
|
279
|
+
</td>
|
280
|
+
</tr>
|
281
|
+
<tr>
|
282
|
+
<td><code>leave_format</code></td>
|
283
|
+
<td>
|
284
|
+
The format of the log output at the end of the method<br>
|
285
|
+
<small><b>Example:</b></small>
|
286
|
+
<ul>
|
287
|
+
<code>leave_format: "└ %1$s (%2$s:%3$d) duration: %4$.2f ms"</code>
|
288
|
+
</ul>
|
289
|
+
<small><b>Parameters:</b></small><br>
|
290
|
+
<ul>
|
291
|
+
<code>%1</code>: the method name<br>
|
292
|
+
<code>%2</code>: the file name<br>
|
293
|
+
<code>%3</code>: the line number<br>
|
294
|
+
<code>%4</code>: the time (in milliseconds) since the corresponding <code>enter</code> method was called
|
295
|
+
</ul>
|
296
|
+
<small><b>Default Value:</b></small>
|
297
|
+
<ul>
|
298
|
+
<code>leave_format: "Leave %1$s (%2$s:%3$d) duration: %4$.3f ms"</code>
|
299
|
+
</ul>
|
300
|
+
</td>
|
301
|
+
</tr>
|
302
|
+
<tr>
|
303
|
+
<td><code>thread_boundary_format</code></td>
|
304
|
+
<td>The format string printed at thread boundaries<br>
|
305
|
+
<small><b>Example:</b></small>
|
306
|
+
<ul>
|
307
|
+
<code>thread_boundary_format: "─────────────────────────────── %1$s #%2$d ──────────────────────────────"</code>
|
308
|
+
</ul>
|
309
|
+
<small><b>Parameters:</b></small><br>
|
310
|
+
<ul>
|
311
|
+
<code>%1</code>: the thread name<br>
|
312
|
+
<code>%2</code>: the object ID of the thread<br>
|
313
|
+
</ul>
|
314
|
+
<small><b>Default Value:</b></small>
|
315
|
+
<ul>
|
316
|
+
<code>thread_boundary_format: "______________________________ %1$s #%2$d ______________________________"</code>
|
317
|
+
</ul>
|
318
|
+
</td>
|
319
|
+
</tr>
|
320
|
+
<tr>
|
321
|
+
<td><code>maximum_indents</code></td>
|
322
|
+
<td>Maximum indentation<br>
|
323
|
+
<small><b>Example:</b></small>
|
324
|
+
<ul>
|
325
|
+
<code>maximum_indents: 16</code>
|
326
|
+
</ul>
|
327
|
+
<small><b>Default Value:</b></small>
|
328
|
+
<ul>
|
329
|
+
<code>maximum_indents: 32</code>
|
330
|
+
</ul>
|
331
|
+
</td>
|
332
|
+
</tr>
|
333
|
+
<tr>
|
334
|
+
<td><code>indent_string</code></td>
|
335
|
+
<td>The code indent string<br>
|
336
|
+
<small><b>Example:</b></small>
|
337
|
+
<ul>
|
338
|
+
<code>indent_string: "│ "</code>
|
339
|
+
</ul>
|
340
|
+
<small><b>Default Value:</b></small>
|
341
|
+
<ul>
|
342
|
+
<code>indent_string: "| "</code>
|
343
|
+
</ul>
|
344
|
+
</td>
|
345
|
+
</tr>
|
346
|
+
<tr>
|
347
|
+
<td><code>data_indent_string</code></td>
|
348
|
+
<td>
|
349
|
+
The data indent string<br>
|
350
|
+
<small><b>Example:</b></small>
|
351
|
+
<ul>
|
352
|
+
<code>data_indent_string: "⧙ "</code>
|
353
|
+
</ul>
|
354
|
+
<small><b>Default Value:</b></small>
|
355
|
+
<ul>
|
356
|
+
<code>data_indent_string: " "</code>
|
357
|
+
</ul>
|
358
|
+
</td>
|
359
|
+
</tr>
|
360
|
+
<tr>
|
361
|
+
<td><code>limit_string</code></td>
|
362
|
+
<td>
|
363
|
+
The string to output if limit is exceeded<br>
|
364
|
+
<small><b>Example:</b></small>
|
365
|
+
<ul>
|
366
|
+
<code>limit_string: "‥‥"</code>
|
367
|
+
</ul>
|
368
|
+
<small><b>Default Value:</b></small>
|
369
|
+
<ul>
|
370
|
+
<code>limit_string: "..."</code>
|
371
|
+
</ul>
|
372
|
+
</td>
|
373
|
+
</tr>
|
374
|
+
<tr>
|
375
|
+
<td><code>circular_reference_string</code></td>
|
376
|
+
<td>
|
377
|
+
The string to output if there is a circular reference<br>
|
378
|
+
<small><b>Example:</b></small>
|
379
|
+
<ul>
|
380
|
+
<code>circular_reference_string: "⤴ "</code>
|
381
|
+
</ul>
|
382
|
+
<small><b>Default Value:</b></small>
|
383
|
+
<ul>
|
384
|
+
<code>circular_reference_string: "*** Circular Reference ***"</code>
|
385
|
+
</ul>
|
386
|
+
</td>
|
387
|
+
</tr>
|
388
|
+
<tr>
|
389
|
+
<td><code>varname_value_separator</code></td>
|
390
|
+
<td>
|
391
|
+
The separator string between variable name and value<br>
|
392
|
+
<small><b>Example:</b></small>
|
393
|
+
<ul>
|
394
|
+
<code>varname_value_separator: " == "</code>
|
395
|
+
</ul>
|
396
|
+
<small><b>Default Value:</b></small>
|
397
|
+
<ul>
|
398
|
+
<code>varname_value_separator: " = "</code>
|
399
|
+
</ul>
|
400
|
+
</td>
|
401
|
+
</tr>
|
402
|
+
<tr>
|
403
|
+
<td><code>key_value_separator</code></td>
|
404
|
+
<td>
|
405
|
+
The separator string for <code>Hash</code> key and value, and object variable name and value<br>
|
406
|
+
<small><b>Example:</b></small>
|
407
|
+
<ul>
|
408
|
+
<code>key_value_separato: " => "</code>
|
409
|
+
</ul>
|
410
|
+
<small><b>Default Value:</b></small>
|
411
|
+
<ul>
|
412
|
+
<code>key_value_separato: ": "</code>
|
413
|
+
</ul>
|
414
|
+
</td>
|
415
|
+
</tr>
|
416
|
+
<tr>
|
417
|
+
<td><code>print_suffix_format</code></td>
|
418
|
+
<td>
|
419
|
+
The format string added by the <code>print</code> method<br>
|
420
|
+
<small><b>Example:</b></small>
|
421
|
+
<ul>
|
422
|
+
<code>print_suffix_format: " (%2$s/%1$s:%3$d)"</code>
|
423
|
+
</ul>
|
424
|
+
<br>
|
425
|
+
<small><b>Parameters:</b></small><br>
|
426
|
+
<ul>
|
427
|
+
<code>%1</code>: the method name<br>
|
428
|
+
<code>%2</code>: the file name<br>
|
429
|
+
<code>%3</code>: the line number<br>
|
430
|
+
</ul>
|
431
|
+
<small><b>Default Value:</b></small>
|
432
|
+
<ul>
|
433
|
+
<code>print_suffix_format: " (%2$s:%3$d)"</code>
|
434
|
+
</ul>
|
435
|
+
</td>
|
436
|
+
</tr>
|
437
|
+
<tr>
|
438
|
+
<td><code>size_format</code></td>
|
439
|
+
<td>
|
440
|
+
Output format for number of elements in <code>Array</code>, <code>Hash</code>, and <code>Set</code><br>
|
441
|
+
<small><b>Example:</b></small>
|
442
|
+
<ul>
|
443
|
+
<code>size_format: "(size=%d)"</code>
|
444
|
+
</ul>
|
445
|
+
<small><b>Parameters:</b></small><br>
|
446
|
+
<ul>
|
447
|
+
<code>%1</code>: number of elements
|
448
|
+
</ul>
|
449
|
+
<small><b>Default Value:</b></small>
|
450
|
+
<ul>
|
451
|
+
<code>size_format: "(size:%d)"</code>
|
452
|
+
</ul>
|
453
|
+
</td>
|
454
|
+
</tr>
|
455
|
+
<tr>
|
456
|
+
<td><code>minimum_output_size</code></td>
|
457
|
+
<td>
|
458
|
+
The minimum number to print the number of elements in an <code>Array</code>, <code>Hash</code>, or <code>Set</code><br>
|
459
|
+
<small><b>Example:</b></small>
|
460
|
+
<ul>
|
461
|
+
<code>minimum_output_size: 2</code>
|
462
|
+
</ul>
|
463
|
+
<small><b>Default Value:</b></small>
|
464
|
+
<ul>
|
465
|
+
<code>minimum_output_size: 256</code>
|
466
|
+
</ul>
|
467
|
+
</td>
|
468
|
+
</tr>
|
469
|
+
<tr>
|
470
|
+
<td><code>length_format</code></td>
|
471
|
+
<td>
|
472
|
+
The format of string length<br>
|
473
|
+
<small><b>Example:</b></small>
|
474
|
+
<ul>
|
475
|
+
<code>length_format: "(length=%d)"</code>
|
476
|
+
</ul>
|
477
|
+
<small><b>Parameters:</b></small><br>
|
478
|
+
<ul>
|
479
|
+
<code>%1</code>: the string length
|
480
|
+
</ul>
|
481
|
+
<small><b>Default Value:</b></small>
|
482
|
+
<ul>
|
483
|
+
<code>length_format: "(length:%d)"</code>
|
484
|
+
</ul>
|
485
|
+
</td>
|
486
|
+
</tr>
|
487
|
+
<tr>
|
488
|
+
<td><code>minimum_output_length</code></td>
|
489
|
+
<td>
|
490
|
+
The minimum length to print the length of the string<br>
|
491
|
+
<small><b>Example:</b></small>
|
492
|
+
<ul>
|
493
|
+
<code>minimum_output_length: 6</code>
|
494
|
+
</ul>
|
495
|
+
<small><b>Default Value:</b></small>
|
496
|
+
<ul>
|
497
|
+
<code>minimum_output_length: 256</code>
|
498
|
+
</ul>
|
499
|
+
</td>
|
500
|
+
</tr>
|
501
|
+
<tr>
|
502
|
+
<td><code>data_output_width</code></td>
|
503
|
+
<td>
|
504
|
+
Data output width<br>
|
505
|
+
<small><b>Example:</b></small>
|
506
|
+
<ul>
|
507
|
+
<code>data_output_width = 100</code>
|
508
|
+
</ul>
|
509
|
+
<small><b>Default Value:</b></small>
|
510
|
+
<ul>
|
511
|
+
<code>data_output_width: 70</code>
|
512
|
+
</ul>
|
513
|
+
</td>
|
514
|
+
</tr>
|
515
|
+
<tr>
|
516
|
+
<td><code>bytes_count_in_line</code></td>
|
517
|
+
<td>
|
518
|
+
Number of lines to output when outputting a string as a byte array<br>
|
519
|
+
<small><b>Example:</b></small>
|
520
|
+
<ul>
|
521
|
+
<code>bytes_count_in_line: 32</code>
|
522
|
+
</ul>
|
523
|
+
<small><b>Default Value:</b></small>
|
524
|
+
<ul>
|
525
|
+
<code>bytes_count_in_line: 16</code>
|
526
|
+
</ul>
|
527
|
+
</td>
|
528
|
+
</tr>
|
529
|
+
<tr>
|
530
|
+
<td><code>collection_limit</code></td>
|
531
|
+
<td>
|
532
|
+
The limit on the number of elements output for <code>Array</code>, <code>Hash</code>, and <code>Set</code><br>
|
533
|
+
<small><b>Example:</b></small>
|
534
|
+
<ul>
|
535
|
+
<code>collection_limit: 64</code>
|
536
|
+
</ul>
|
537
|
+
<small><b>Default Value:</b></small>
|
538
|
+
<ul>
|
539
|
+
<code>collection_limit: 128</code>
|
540
|
+
</ul>
|
541
|
+
</td>
|
542
|
+
</tr>
|
543
|
+
<tr>
|
544
|
+
<td><code>string_limit</code></td>
|
545
|
+
<td>
|
546
|
+
文字列の出力文字数の制限値<br>
|
547
|
+
<small><b>Example:</b></small>
|
548
|
+
<ul>
|
549
|
+
<code>string_limit: 64</code>
|
550
|
+
</ul>
|
551
|
+
<small><b>Default Value:</b></small>
|
552
|
+
<ul>
|
553
|
+
<code>string_limit: 256</code>
|
554
|
+
</ul>
|
555
|
+
</td>
|
556
|
+
</tr>
|
557
|
+
<tr>
|
558
|
+
<td><code>bytes_limit</code></td>
|
559
|
+
<td>
|
560
|
+
The limit on the number of characters to be output a string as a byte array<br>
|
561
|
+
<small><b>Example:</b></small>
|
562
|
+
<ul>
|
563
|
+
<code>bytes_limit: 64</code>
|
564
|
+
</ul>
|
565
|
+
<small><b>Default Value:</b></small>
|
566
|
+
<ul>
|
567
|
+
<code>bytes_limit: 256</code>
|
568
|
+
</ul>
|
569
|
+
</td>
|
570
|
+
</tr>
|
571
|
+
<tr>
|
572
|
+
<td><code>reflection_limit</code></td>
|
573
|
+
<td>
|
574
|
+
The limit of reflection nesting<br>
|
575
|
+
<small><b>Example:</b></small>
|
576
|
+
<ul>
|
577
|
+
<code>reflection_limit: 3</code>
|
578
|
+
</ul>
|
579
|
+
<small><b>Default Value:</b></small>
|
580
|
+
<ul>
|
581
|
+
<code>reflection_limit: 4</code>
|
582
|
+
</ul>
|
583
|
+
</td>
|
584
|
+
</tr>
|
585
|
+
</table>
|
33
586
|
|
34
|
-
|
587
|
+
### 6. License
|
35
588
|
|
36
|
-
|
589
|
+
[MIT License(MIT)](LICENSE.txt)
|
37
590
|
|
38
|
-
|
591
|
+
_(C) 2025 Masato Kokubo_
|
39
592
|
|
40
|
-
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|