@stonyx/logs 1.0.1-beta.16 → 1.0.1-beta.17

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.
package/dist/index.d.ts CHANGED
@@ -14,6 +14,9 @@ export default class Log {
14
14
  color: Color;
15
15
  typeOptions: Record<string, Partial<LogOptions>>;
16
16
  [key: string]: unknown;
17
+ info: (content: string, logToFile?: boolean, overwrite?: boolean) => Promise<void>;
18
+ warn: (content: string, logToFile?: boolean, overwrite?: boolean) => Promise<void>;
19
+ error: (content: string, logToFile?: boolean, overwrite?: boolean) => Promise<void>;
17
20
  constructor(options?: Partial<LogOptions>);
18
21
  defineType(type: string, setting: ColorSetting, options?: Partial<LogOptions> | null): void;
19
22
  createConvenienceMethod(type: string): void;
package/dist/index.js CHANGED
@@ -147,7 +147,7 @@ export default class Log {
147
147
  }
148
148
  // attempts to create file and/or directory if they don't already exist
149
149
  async validateFileAndDirectory(path, targetLog) {
150
- const errorMethod = this.error || console.error;
150
+ const errorMethod = this.error;
151
151
  mkdirSync(path, { recursive: true });
152
152
  await fsp.access(targetLog).catch(() => {
153
153
  fsp.writeFile(targetLog, '').catch(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stonyx/logs",
3
- "version": "1.0.1-beta.16",
3
+ "version": "1.0.1-beta.17",
4
4
  "description": "Simplified logging for node applications",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",