Skip to content

Commit

Permalink
Revert "BREAKING CHANGE: updated and added new log properties (#81)" (#…
Browse files Browse the repository at this point in the history
…82)

This reverts commit e2671e6.
  • Loading branch information
itaykl authored Nov 5, 2020
1 parent e2671e6 commit a16cf8c
Show file tree
Hide file tree
Showing 11 changed files with 2,415 additions and 1,005 deletions.
19 changes: 0 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,25 +52,6 @@ Those properties are:

This interface represents the log properties that will be logged through the `PolarisLogger`.

Those properties are:
- `throwable`: The throwable object, if an error occurred. *any | Optional*
- `elapsedTime`: You can provide an elapsed execution time of the operation. *number | Optional*
- `logId`: You can provide a unique log id for each log. *string | Optional*
- `customProperties`: You can provide custom properties, and it will be piped to the log. *any | Optional*
- `response`: The response sent to the client. *any | Optional*
- `messageId`: A unique identifier of the request/operation process. Something like a transaction id of a process. *string | Optional*
- `recordId`: A unique identifier of the log(generated automatically). *string | Optional*
- `eventKind`: The kind of event that happened. An event id. *string | Optional*
- `eventKindDescription`: A description of the event kind that occurred. *EventKindDescription | Optional*
- `reality`: You can provide The reality which the operation took place in. *Reality | Optional*
- `request`: The request sent by the client. *Request | Optional*
- `entity`: You can provide an entity of your query you want to record. Note that in case you log both entity and entities properties, entity will merged into entities and only entities will be logged. *Entity | Optional*
- `entities`: You can provide entities of your query you want to record. Note that in case you log both entity and entities properties, entity will merged into entities and only entities will be logged. *Entity[] | Optional*
- `upn`: The user identifier that executed the operation. *string | Optional*
- `ip`: The ip address of the server that the request came from. *string | Optional*
- `host`: The server/container name where the event occurred. *string | Optional*
- `groupId`: The attributes that defines the relation between the entities to the event that occurred. *GroupId | Optional*

### PolarisLogger

This class interacts with the actual winston logger and responsible for logging the properties that was provided to him.
Expand Down
3,312 changes: 2,401 additions & 911 deletions package-lock.json

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@
"homepage": "https://github.com/Enigmatis/polaris-logs#readme",
"dependencies": {
"@enigmatis/polaris-common": "^1.4.5",
"clean-deep": "^3.4.0",
"clean-deep": "^3.3.0",
"object-sizeof": "^1.6.1",
"serialize-error": "^7.0.1",
"uuid": "^8.3.1",
"uuid": "^8.3.0",
"winston": "^3.3.3",
"winston-daily-rotate-file": "^4.5.0",
"winston-logstash-ts": "^0.2.3",
Expand All @@ -75,22 +75,22 @@
"@commitlint/config-conventional": "^9.1.2",
"@semantic-release/changelog": "^5.0.1",
"@semantic-release/git": "^9.0.0",
"@types/jest": "^26.0.15",
"@types/node": "^14.14.6",
"@types/jest": "^26.0.10",
"@types/node": "^14.0.27",
"@types/serialize-error": "^4.0.1",
"@types/uuid": "^8.3.0",
"@types/winston": "^2.4.4",
"@typescript-eslint/eslint-plugin": "^3.10.1",
"@typescript-eslint/parser": "^3.10.1",
"eslint": "^7.12.1",
"eslint-config-prettier": "^6.15.0",
"@typescript-eslint/eslint-plugin": "^3.9.0",
"@typescript-eslint/parser": "^3.9.0",
"eslint": "^7.7.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-prettier": "^3.1.4",
"husky": "^4.3.0",
"jest": "^26.6.3",
"prettier": "^2.1.2",
"husky": "^4.2.5",
"jest": "^26.4.0",
"prettier": "^2.0.5",
"rimraf": "^3.0.2",
"semantic-release": "^17.2.2",
"ts-jest": "^26.4.3",
"semantic-release": "^17.1.1",
"ts-jest": "^26.2.0",
"typescript": "^3.9.7"
},
"husky": {
Expand Down
5 changes: 0 additions & 5 deletions src/entities/central-point.ts

This file was deleted.

12 changes: 1 addition & 11 deletions src/entities/entity.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
import { CentralPoint } from './central-point';
import { Identifiable } from './identifiable';
import { KeyValuePair } from './key-value-pair';
import { Reality } from './reality';
import { SubEntity } from './sub-entity';

export interface Entity {
id?: string;
reality?: Reality;
name?: string;
secondaryIds?: KeyValuePair<string, any>[];
operationalData?: KeyValuePair<string, any>[];
correlationIds?: Identifiable[];
subEntities?: SubEntity[];
criticalFields?: KeyValuePair<string, any>[];
centralPoint?: CentralPoint;
isClassified?: boolean;
secondaryIds?: string[];
}
8 changes: 0 additions & 8 deletions src/entities/group-id.ts

This file was deleted.

7 changes: 0 additions & 7 deletions src/entities/identifiable.ts

This file was deleted.

4 changes: 0 additions & 4 deletions src/entities/key-value-pair.ts

This file was deleted.

11 changes: 0 additions & 11 deletions src/entities/sub-entity.ts

This file was deleted.

2 changes: 0 additions & 2 deletions src/polaris-log-properties.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Entity, EventKindDescription, Reality, Request } from './entities';
import { GroupId } from './entities/group-id';

export interface PolarisLogProperties {
throwable?: any;
Expand All @@ -18,5 +17,4 @@ export interface PolarisLogProperties {
upn?: string;
ip?: string;
host?: string;
groupId?: GroupId;
}
14 changes: 0 additions & 14 deletions test/polaris-logger.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,18 +186,4 @@ describe('polaris-logger tests', () => {
}),
);
});

test('info - logging message with groupId - groupId is in the log', () => {
const logger = new PolarisLogger(config, appProps);
logger.info(message, {
groupId: { id: '0', action: 'Split' },
});
expect(loggerImplMock.info).toHaveBeenCalledWith(
expect.objectContaining({
message,
recordId: expect.anything(),
groupId: { id: '0', action: 'Split' },
}),
);
});
});

0 comments on commit a16cf8c

Please sign in to comment.