Skip to content

Commit

Permalink
refactor(rstream-log): deprecate LogEntry
Browse files Browse the repository at this point in the history
- use migrated type from thi.ng/logger pkg
  • Loading branch information
postspectacular committed Aug 3, 2022
1 parent b2cd409 commit ef46381
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
3 changes: 3 additions & 0 deletions packages/rstream-log/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import type { IID } from "@thi.ng/api";
import type { ILogger as APILogger, LogLevel } from "@thi.ng/logger";
import type { ISubscribable } from "@thi.ng/rstream";

/**
* @deprecated moved to thi.ng/logger package
*/
export interface LogEntry extends Array<any> {
[0]: LogLevel;
[1]: string;
Expand Down
3 changes: 1 addition & 2 deletions packages/rstream-log/src/filter.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import type { LogLevel } from "@thi.ng/logger";
import { isString } from "@thi.ng/checks/is-string";
import type { LogEntry, LogLevel } from "@thi.ng/logger";
import type { Transducer } from "@thi.ng/transducers";
import { filter } from "@thi.ng/transducers/filter";
import type { LogEntry } from "./api.js";

export const onlyLevel = (level: LogLevel): Transducer<LogEntry, LogEntry> =>
filter((l) => l[0] === level);
Expand Down
4 changes: 2 additions & 2 deletions packages/rstream-log/src/format.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { LogLevel } from "@thi.ng/logger/api";
import { LogEntry, LogLevel } from "@thi.ng/logger/api";
import { stringify } from "@thi.ng/strings/stringify";
import type { Transducer } from "@thi.ng/transducers";
import { map } from "@thi.ng/transducers/map";
import type { BodyFormat, DateFormat, LogEntry, LogEntryObj } from "./api.js";
import type { BodyFormat, DateFormat, LogEntryObj } from "./api.js";

export const isoDate = (dt: number) => new Date(dt).toISOString();

Expand Down
4 changes: 2 additions & 2 deletions packages/rstream-log/src/logger.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { illegalArity } from "@thi.ng/errors/illegal-arity";
import { LogLevel } from "@thi.ng/logger/api";
import { LogEntry, LogLevel } from "@thi.ng/logger/api";
import { CloseMode, ISubscribable } from "@thi.ng/rstream/api";
import { __nextID } from "@thi.ng/rstream/idgen";
import { StreamMerge } from "@thi.ng/rstream/merge";
import type { ILogger, LogEntry } from "./api.js";
import type { ILogger } from "./api.js";

export class Logger extends StreamMerge<LogEntry, LogEntry> implements ILogger {
level: LogLevel;
Expand Down

0 comments on commit ef46381

Please sign in to comment.