File tree Expand file tree Collapse file tree 3 files changed +9
-6
lines changed
crates/core/src/prelude/src Expand file tree Collapse file tree 3 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ members = [
6
6
]
7
7
8
8
[workspace .package ]
9
- version = " 1.5.0 "
9
+ version = " 1.5.1 "
10
10
edition = " 2021"
11
11
authors = [" The Extism Authors" ]
12
12
license = " BSD-Clause-3"
Original file line number Diff line number Diff line change @@ -253,12 +253,15 @@ module.exports = { count };
253
253
254
254
### Logging
255
255
256
- At the current time, calling ` console.log ` emits an ` info ` log. Please file an
257
- issue or PR if you want to expose the raw logging interface:
256
+ There are several functions that can be used for logging:
258
257
259
258
``` javascript
260
259
function logStuff () {
261
- console .log (" Hello, World!" );
260
+ console .info (" Info" );
261
+ console .debug (" Debug" );
262
+ console .error (" Error" );
263
+ console .warn (" Warning" );
264
+ console .log (" Log" ); // Alias for console.info
262
265
}
263
266
264
267
module .exports = { logStuff };
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ function stringifyArg(arg: any): string {
24
24
25
25
if ( typeof arg === 'object' ) {
26
26
if ( arg instanceof Error ) {
27
- return arg . stack || `${ arg . name } : ${ arg . message } ` ;
27
+ return `${ arg . name } : ${ arg . message } ${ arg . stack ? '\n' : '' } ${ arg . stack } ` ;
28
28
}
29
29
if ( arg instanceof Set ) {
30
30
return `Set(${ arg . size } ) { ${ Array . from ( arg ) . map ( String ) . join ( ', ' ) } }` ;
@@ -71,4 +71,4 @@ const console = {
71
71
72
72
globalThis . console = console ;
73
73
74
- export { } ;
74
+ export { } ;
You can’t perform that action at this time.
0 commit comments