Skip to content

Commit

Permalink
feat: export pretty-logs
Browse files Browse the repository at this point in the history
  • Loading branch information
gitcoindev committed Dec 8, 2023
1 parent a6103d9 commit bb9e691
Show file tree
Hide file tree
Showing 8 changed files with 161 additions and 24 deletions.
1 change: 0 additions & 1 deletion dist/logs.js.map

This file was deleted.

23 changes: 23 additions & 0 deletions dist/pretty-logs.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
declare class PrettyLogs {
constructor();
fatal(message: string, metadata?: any): void;
error(message: string, metadata?: any): void;
ok(message: string, metadata?: any): void;
info(message: string, metadata?: any): void;
debug(message: string, metadata?: any): void;
verbose(message: string, metadata?: any): void;
private _logWithStack;
private _colorizeText;
private _formatStackTrace;
private _isEmpty;
private _log;
}
declare enum LogLevel {
FATAL = "fatal",
ERROR = "error",
INFO = "info",
VERBOSE = "verbose",
DEBUG = "debug",
}

export { LogLevel, PrettyLogs };
126 changes: 126 additions & 0 deletions dist/pretty-logs.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/pretty-logs.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 1 addition & 22 deletions dist/logs.d.ts → dist/tables/logs.d.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,6 @@
import { SupabaseClient } from "@supabase/supabase-js";
import { Context } from "probot";

declare class PrettyLogs {
constructor();
fatal(message: string, metadata?: any): void;
error(message: string, metadata?: any): void;
ok(message: string, metadata?: any): void;
info(message: string, metadata?: any): void;
debug(message: string, metadata?: any): void;
verbose(message: string, metadata?: any): void;
private _logWithStack;
private _colorizeText;
private _formatStackTrace;
private _isEmpty;
private _log;
}
declare enum LogLevel {
FATAL = "fatal",
ERROR = "error",
INFO = "info",
VERBOSE = "verbose",
DEBUG = "debug",
}
import { LogLevel, PrettyLogs } from "../pretty-logs.js";

declare class LogReturn {
logMessage: LogMessage;
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions dist/tables/logs.js.map

Large diffs are not rendered by default.

10 changes: 9 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"type": "module",
"tsup": {
"entry": [
"src/supabase/helpers/tables/logs.ts"
"src/supabase/helpers/tables/logs.ts",
"src/supabase/helpers/pretty-logs.ts"
],
"splitting": false,
"sourcemap": true,
Expand All @@ -23,13 +24,20 @@
"*": {
".": [
"./dist/logs.d.ts"
],
"pretty-logs": [
"./dist/pretty-logs.d.ts"
]
}
},
"exports": {
".": {
"types": "./dist/logs.d.ts",
"default": "./dist/logs.js"
},
"./pretty-logs": {
"types": "./dist/pretty-logs.d.ts",
"default": "./dist/pretty-logs.js"
}
},
"scripts": {
Expand Down

0 comments on commit bb9e691

Please sign in to comment.