Skip to content

Commit

Permalink
cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
davemarco committed Sep 19, 2024
1 parent b70bdb6 commit 64a3f7a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 21 deletions.
3 changes: 2 additions & 1 deletion new-log-viewer/src/services/LogFileManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,8 @@ class LogFileManager {
const result: boolean = this.#decoder.changeLogLevelFilter(logLevelFilter);

if (false === result) {
throw new Error("Error changing log level filter");
throw new Error(`Error changing log level filter as feature not yet
implemented for this file type on new log viewer`);
}

logLevelFilter ? this.#computeFilteredPageBoundaries() : this.#computeUnfilteredPageBoundaries()

Check warning on line 230 in new-log-viewer/src/services/LogFileManager.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/LogFileManager.ts#L230

[@stylistic/js/max-len] This line has a length of 104. Maximum allowed is 100.

Check failure on line 230 in new-log-viewer/src/services/LogFileManager.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/LogFileManager.ts#L230

[no-unused-expressions] Expected an assignment or function call and instead saw an expression.

Check failure on line 230 in new-log-viewer/src/services/LogFileManager.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/LogFileManager.ts#L230

[@stylistic/js/multiline-ternary] Expected newline between test and consequent of ternary expression.

Check failure on line 230 in new-log-viewer/src/services/LogFileManager.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/LogFileManager.ts#L230

[@stylistic/js/multiline-ternary] Expected newline between consequent and alternate of ternary expression.
Expand Down
1 change: 1 addition & 0 deletions new-log-viewer/src/services/MainWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ onmessage = async (ev: MessageEvent<MainWorkerReqMessage>) => {
throw new Error("Log file manager hasn't been initialized");
}
LOG_FILE_MANAGER.changeLogLevelFilter(args.logLevelFilter);

postResp(WORKER_RESP_CODE.VIEW_INFO, {
numFilteredEvents: LOG_FILE_MANAGER.numFilteredEvents,
firstLogEventNumPerPage: LOG_FILE_MANAGER.firstLogEventNumPerPage,
Expand Down
8 changes: 6 additions & 2 deletions new-log-viewer/src/services/decoders/ClpIrDecoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,14 @@ class ClpIrDecoder implements Decoder {
changeLogLevelFilter (logLevelFilter: LogLevelFilter): boolean {
// eslint-disable-next-line no-warning-comments
// TODO fix this after log level filtering is implemented in clp-ffi-js
return true;
return false;
}

decode (beginIdx: number, endIdx: number): Nullable<DecodeResultType[]> {
decodeRange (beginIdx: number, endIdx: number): Nullable<DecodeResultType[]> {
return this.#streamReader.decodeRange(beginIdx, endIdx);
}

decodeFilteredRange (beginIdx: number, endIdx: number): Nullable<DecodeResultType[]> {
return this.#streamReader.decodeRange(beginIdx, endIdx);
}
}
Expand Down
18 changes: 0 additions & 18 deletions new-log-viewer/src/services/decoders/JsonlDecoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,6 @@ import {
LogLevelFilter,
} from "../../typings/logs";
import LogbackFormatter from "../formatters/LogbackFormatter";

Check failure on line 22 in new-log-viewer/src/services/decoders/JsonlDecoder.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/JsonlDecoder.ts#L22

[import/newline-after-import] Expected 2 empty lines after import statement not followed by another import.
import { number } from "prop-types";


/**
* Set the default log level filter (i.e. all levels are selected, so the array should include all
* log indices).
*
* @param length
* @return Array with indices as values (i.e [0, 1, 2, 3, ..., length - 1])
*/
const createIndicesArray = (length: number): number[] => {
const LogIndices: number[] = Array.from(
{length: length},
(_, index) => index
);

return LogIndices;
};

/**
* A decoder for JSONL (JSON lines) files that contain log events. See `JsonlDecodeOptionsType` for
Expand Down

0 comments on commit 64a3f7a

Please sign in to comment.