Skip to content

Commit 8cb3dec

Browse files
Removed duplicates of debug.info()
1 parent dcc1835 commit 8cb3dec

File tree

1 file changed

+9
-63
lines changed
  • content/en-us/reference/engine/libraries

1 file changed

+9
-63
lines changed

content/en-us/reference/engine/libraries/debug.yaml

Lines changed: 9 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -139,54 +139,6 @@ functions:
139139
fnA()
140140
```
141141
142-
Note that this function is similar to
143-
[debug.getinfo](https://www.lua.org/pil/23.1.html), an unavailable part of
144-
the standard Lua library which serves a similar purpose.
145-
parameters:
146-
- name: level
147-
type: number
148-
default:
149-
summary: |
150-
Determines at what level of the call stack the information returned
151-
should describe. A value of `1` represents the function which is
152-
calling `Library.debug.info()`, a value of `2` represents the function
153-
that called that function, and so on.
154-
- name: options
155-
type: string
156-
default:
157-
summary: |
158-
A string that describes what the returned information should
159-
represent. It must only contain 0 or 1 instances of the characters
160-
`slnaf`, each representing a piece of information:
161-
162-
- `s` ([string](/luau/strings.md)) — The function source identifier,
163-
equal to the full name of the script the function is defined in.
164-
- `l` ([number](/luau/numbers.md)) — The line number of the function
165-
call represented by `level`.
166-
- `n` ([string](/luau/strings.md)) — The name of the function; may be
167-
`nil` for anonymous functions and C functions without an assigned
168-
debug name.
169-
- `a` ([number](/luau/numbers.md), [boolean](/luau/booleans.md)) —
170-
Arity of the function, which refers to the parameter count and
171-
whether the function is variadic.
172-
- `f` ([function](/luau/functions.md)) — The function which was
173-
inspected.
174-
returns:
175-
- type: Tuple
176-
summary: ''
177-
tags:
178-
code_samples:
179-
- name: debug.info
180-
summary: |
181-
Traverses the entire stack of current thread and returns a string
182-
containing the call stack of target function details.
183-
description: |
184-
Allows programmatic inspection of the call stack. This function differs
185-
from `Library.debug.traceback()` in that it guarantees the format of the
186-
data it returns. This is useful for general logging and filtering purposes
187-
as well as for sending the data to systems expecting structured input,
188-
such as crash aggregation.
189-
190142
```lua
191143
local function fnA()
192144
@@ -205,12 +157,14 @@ functions:
205157
[debug.getinfo](https://www.lua.org/pil/23.1.html), an unavailable part of
206158
the standard Lua library which serves a similar purpose.
207159
parameters:
208-
- name: function
209-
type: function
160+
- name: level
161+
type: number
210162
default:
211163
summary: |
212-
The function of the call stack which the information returned should
213-
describe.
164+
Determines at what level of the call stack the information returned
165+
should describe. A value of `1` represents the function which is
166+
calling `Library.debug.info()`, a value of `2` represents the function
167+
that called that function, and so on.
214168
- name: options
215169
type: string
216170
default:
@@ -221,8 +175,8 @@ functions:
221175
222176
- `s` ([string](/luau/strings.md)) — The function source identifier,
223177
equal to the full name of the script the function is defined in.
224-
- `l` ([number](/luau/numbers.md)) — The line that `function` is
225-
defined on.
178+
- `l` ([number](/luau/numbers.md)) — The line number of the function
179+
call represented by `level`.
226180
- `n` ([string](/luau/strings.md)) — The name of the function; may be
227181
`nil` for anonymous functions and C functions without an assigned
228182
debug name.
@@ -247,15 +201,7 @@ functions:
247201
as well as for sending the data to systems expecting structured input,
248202
such as crash aggregation.
249203
250-
```lua
251-
local function fnA()
252-
-- Output source identifier ("s") and line ("l") at levels 1 and 2
253-
print(debug.info(1, "sl")) --> fnA() 3
254-
print(debug.info(2, "sl")) --> fnA() 7
255-
end
256-
257-
fnA()
258-
```
204+
259205
260206
Note that this function is similar to
261207
[debug.getinfo](https://www.lua.org/pil/23.1.html), an unavailable part of

0 commit comments

Comments
 (0)