-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[logger] Adding react-native logger support (#30076)
### Packages impacted by this PR - @azure/logger ### Issues associated with this PR - #30065 ### Describe the problem that is addressed by this PR Adds logging support through the browser implementation of the logger logic. ### What are the possible designs available to address the problem? If there are more than one possible design, why was the one in this PR chosen? ### Are there test cases added in this PR? _(If not, why?)_ ### Provide a list of related PRs _(if any)_ ### Command used to generate this PR:**_(Applicable only to SDK release request PRs)_ ### Checklists - [ ] Added impacted package name to the issue description - [ ] Does this PR needs any fixes in the SDK Generator?** _(If so, create an Issue in the [Autorest/typescript](https://github.com/Azure/autorest.typescript) repository and link it here)_ - [ ] Added a changelog (if necessary)
- Loading branch information
1 parent
6d67d3a
commit c16dc86
Showing
6 changed files
with
48 additions
and
32 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -1,19 +1,4 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
|
||
export function log(...args: any[]): void { | ||
if (args.length > 0) { | ||
const firstArg = String(args[0]); | ||
if (firstArg.includes(":error")) { | ||
console.error(...args); | ||
} else if (firstArg.includes(":warning")) { | ||
console.warn(...args); | ||
} else if (firstArg.includes(":info")) { | ||
console.info(...args); | ||
} else if (firstArg.includes(":verbose")) { | ||
console.debug(...args); | ||
} else { | ||
console.debug(...args); | ||
} | ||
} | ||
} | ||
export { log } from "./log.common.js"; |
This file contains 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,4 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
|
||
export { log } from "./log.common.js"; |
This file contains 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,19 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
|
||
export function log(...args: any[]): void { | ||
if (args.length > 0) { | ||
const firstArg = String(args[0]); | ||
if (firstArg.includes(":error")) { | ||
console.error(...args); | ||
} else if (firstArg.includes(":warning")) { | ||
console.warn(...args); | ||
} else if (firstArg.includes(":info")) { | ||
console.info(...args); | ||
} else if (firstArg.includes(":verbose")) { | ||
console.debug(...args); | ||
} else { | ||
console.debug(...args); | ||
} | ||
} | ||
} |
This file contains 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 |
---|---|---|
@@ -1,19 +1,4 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
|
||
export function log(...args: any[]): void { | ||
if (args.length > 0) { | ||
const firstArg = String(args[0]); | ||
if (firstArg.includes(":error")) { | ||
console.error(...args); | ||
} else if (firstArg.includes(":warning")) { | ||
console.warn(...args); | ||
} else if (firstArg.includes(":info")) { | ||
console.info(...args); | ||
} else if (firstArg.includes(":verbose")) { | ||
console.debug(...args); | ||
} else { | ||
console.debug(...args); | ||
} | ||
} | ||
} | ||
export { log } from "./log.common.js"; |
This file contains 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,4 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
|
||
export { log } from "./log.common.js"; |
This file contains 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,19 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
|
||
export function log(...args: any[]): void { | ||
if (args.length > 0) { | ||
const firstArg = String(args[0]); | ||
if (firstArg.includes(":error")) { | ||
console.error(...args); | ||
} else if (firstArg.includes(":warning")) { | ||
console.warn(...args); | ||
} else if (firstArg.includes(":info")) { | ||
console.info(...args); | ||
} else if (firstArg.includes(":verbose")) { | ||
console.debug(...args); | ||
} else { | ||
console.debug(...args); | ||
} | ||
} | ||
} |