Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export { getTimeGivenProgression } from './utils/animation/cubic-bezier';
export { createGesture } from './utils/gesture';
export { initialize } from './global/ionic-global';
export { componentOnReady } from './utils/helpers';
export { LogLevel } from './utils/logging';
export { LogLevel, printIonWarning, printIonError } from './utils/logging';
export { isPlatform, Platforms, PlatformConfig, getPlatforms } from './utils/platform';
export { IonicSafeString } from './utils/sanitization';
export { IonicConfig, getMode, setupConfig } from './utils/config';
Expand Down
4 changes: 4 additions & 0 deletions core/src/utils/logging/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ const isLogLevelEnabled = (minimum: LogLevel): boolean => {
* to indicate the library that is warning the developer.
*
* @param message - The string message to be logged to the console.
*
* @internal
*/
export const printIonWarning = (message: string, ...params: any[]) => {
if (isLogLevelEnabled(LogLevel.WARN)) {
Expand All @@ -47,6 +49,8 @@ export const printIonWarning = (message: string, ...params: any[]) => {
*
* @param message - The string message to be logged to the console.
* @param params - Additional arguments to supply to the console.error.
*
* @internal
*/
export const printIonError = (message: string, ...params: any[]) => {
if (isLogLevelEnabled(LogLevel.ERROR)) {
Expand Down
3 changes: 2 additions & 1 deletion packages/vue/src/components/IonRouterOutlet.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { AnimationBuilder } from "@ionic/core/components";
import {
printIonWarning,
LIFECYCLE_DID_ENTER,
LIFECYCLE_DID_LEAVE,
LIFECYCLE_WILL_ENTER,
Expand Down Expand Up @@ -292,7 +293,7 @@ export const IonRouterOutlet = /*@__PURE__*/ defineComponent({
* methods to work properly.
*/
if (enteringEl === undefined) {
console.warn(`[@ionic/vue Warning]: The view you are trying to render for path ${routeInfo.pathname} does not have the required <ion-page> component. Transitions and lifecycle methods may not work as expected.
printIonWarning(`The view you are trying to render for path ${routeInfo.pathname} does not have the required <ion-page> component. Transitions and lifecycle methods may not work as expected.

See https://ionicframework.com/docs/vue/navigation#ionpage for more information.`);
}
Expand Down
5 changes: 3 additions & 2 deletions packages/vue/src/hooks/lifecycle.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { printIonWarning } from "@ionic/core/components";
import type { ComponentInternalInstance } from "vue";
import { getCurrentInstance } from "vue";

Expand Down Expand Up @@ -35,8 +36,8 @@ const injectHook = (

return wrappedHook;
} else {
console.warn(
"[@ionic/vue]: Ionic Lifecycle Hooks can only be used during execution of setup()."
printIonWarning(
"Ionic Lifecycle Hooks can only be used during execution of setup()."
);
}
};
Expand Down
Loading