-
Notifications
You must be signed in to change notification settings - Fork 83
refactor: Integrate logging package #755
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
57 commits
Select commit
Hold shift + click to select a range
92e3ab7
utils integrated
ozayr-zaviar 37cab7b
logging integrated
ozayr-zaviar 1d5368c
testcases fix
ozayr-zaviar 82b0fa1
revert logging
ozayr-zaviar 2843dcc
utils merged in optimizely sdk
ozayr-zaviar 8574c7e
small changes removed
ozayr-zaviar f725a21
Merge branch 'master' into uzair/consolidate-packages
ozayr-zaviar 28905d0
ts config added because jest and mocha use similar declarations
ozayr-zaviar 11518e1
type warning fixed
ozayr-zaviar d3371ce
more types fixed
ozayr-zaviar da73e11
fix
ozayr-zaviar 069e501
fix
ozayr-zaviar bc6d5fb
fix
ozayr-zaviar 3b758bd
type defined
ozayr-zaviar 73e1db8
type fix
ozayr-zaviar d41146d
Merge branch 'master' into uzair/consolidate-packages
ozayr-zaviar 550c3ba
headers updated
ozayr-zaviar 39b5d69
fix
ozayr-zaviar d00a828
correct notification type imported
ozayr-zaviar c958cda
comment addressed
ozayr-zaviar c36dee9
headers updated and notification center moved
ozayr-zaviar 19d1ca0
comments addressed
ozayr-zaviar 6622d21
removed Notification center interface
ozayr-zaviar 71f7e14
notification center renamed
ozayr-zaviar 4b9c124
notification type corrected
ozayr-zaviar 9e3d8d4
renamed a conflicting interface
zashraf1985 bef10a0
removed unused line
zashraf1985 dcdd371
comments addressed
ozayr-zaviar 4fc4b51
fns exported in same import
ozayr-zaviar 201800e
intergrate logging
ozayr-zaviar e55fdc0
testcases fix
ozayr-zaviar 0146bf1
logging rollup corrected
ozayr-zaviar 65a3f0a
rollup fixed
ozayr-zaviar d594c09
fixed some build issues
zashraf1985 a8e7858
comment addressed
ozayr-zaviar def50b4
headers updated
ozayr-zaviar 0d088e7
logging path corrected
ozayr-zaviar 0bb709c
Merge branch 'master' into uzair/consolidate-packages
ozayr-zaviar f352bc6
Merge branch 'uzair/consolidate-packages' into uzair/consolidate-log
ozayr-zaviar f36baf4
comments addressed
ozayr-zaviar aa90124
Merge branch 'uzair/consolidate-packages' into uzair/consolidate-log
ozayr-zaviar ac3451b
Merge branch 'master' into uzair/consolidate-log
ozayr-zaviar d82888a
Update package-lock.json
ozayr-zaviar 4234caf
previous utils paths fixed
ozayr-zaviar bc7d7e6
lint fix
ozayr-zaviar 98962c1
test
ozayr-zaviar 4836a2c
test
ozayr-zaviar ef5bc91
revert
ozayr-zaviar a47ce8d
browser tests fixed
ozayr-zaviar 9accd13
entry level packages fixed
ozayr-zaviar 685f03e
fixes
ozayr-zaviar 2529776
Merge branch 'master' into uzair/consolidate-log
zashraf1985 6132ed9
headers updated
ozayr-zaviar 10adac2
Merge branch 'master' into uzair/consolidate-log
zashraf1985 72bc98b
fixed helper issue
ozayr-zaviar 0d8be1e
Merge branch 'uzair/consolidate-log' of github.com:optimizely/javascr…
5963ea8
removed unused dependencies from package.json
zashraf1985 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
packages/optimizely-sdk/lib/modules/logging/errorHandler.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/** | ||
* Copyright 2019, Optimizely | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
/** | ||
* @export | ||
* @interface ErrorHandler | ||
*/ | ||
export interface ErrorHandler { | ||
/** | ||
* @param {Error} exception | ||
* @memberof ErrorHandler | ||
*/ | ||
handleError(exception: Error): void | ||
} | ||
|
||
/** | ||
* @export | ||
* @class NoopErrorHandler | ||
* @implements {ErrorHandler} | ||
*/ | ||
export class NoopErrorHandler implements ErrorHandler { | ||
/** | ||
* @param {Error} exception | ||
* @memberof NoopErrorHandler | ||
*/ | ||
handleError(exception: Error): void { | ||
// no-op | ||
return | ||
} | ||
} | ||
|
||
let globalErrorHandler: ErrorHandler = new NoopErrorHandler() | ||
|
||
/** | ||
* @export | ||
* @param {ErrorHandler} handler | ||
*/ | ||
export function setErrorHandler(handler: ErrorHandler): void { | ||
globalErrorHandler = handler | ||
} | ||
|
||
/** | ||
* @export | ||
* @returns {ErrorHandler} | ||
*/ | ||
export function getErrorHandler(): ErrorHandler { | ||
return globalErrorHandler | ||
} | ||
|
||
/** | ||
* @export | ||
*/ | ||
export function resetErrorHandler(): void { | ||
globalErrorHandler = new NoopErrorHandler() | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/** | ||
* Copyright 2019, Optimizely | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
export * from './errorHandler' | ||
export * from './models' | ||
export * from './logger' |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you need to introduce the concept of logHelper here. Why importing directly from
./modules/loggin
does not work?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Karma browser test was not able to locate the package unless it is defined in the default.