mirror of
https://github.com/ivabus/gui
synced 2025-04-23 14:07:14 +03:00
fix logging (#666)
This commit is contained in:
parent
e9b5253e3e
commit
6b9d4ec1d7
4 changed files with 7 additions and 7 deletions
|
@ -6,7 +6,7 @@ import { hooks } from "@teaxyz/lib";
|
||||||
|
|
||||||
import log from "./logger";
|
import log from "./logger";
|
||||||
import { MainWindowNotifier } from "./types";
|
import { MainWindowNotifier } from "./types";
|
||||||
import { Installation, Package, porcelain } from "@teaxyz/lib";
|
import { Installation, porcelain } from "@teaxyz/lib";
|
||||||
import type { Resolution } from "@teaxyz/lib/script/src/plumbing/resolve";
|
import type { Resolution } from "@teaxyz/lib/script/src/plumbing/resolve";
|
||||||
|
|
||||||
export async function installPackage(
|
export async function installPackage(
|
||||||
|
@ -19,7 +19,7 @@ export async function installPackage(
|
||||||
const qualifedPackage = `${full_name}@${version}`;
|
const qualifedPackage = `${full_name}@${version}`;
|
||||||
log.info(`installing package ${qualifedPackage}`);
|
log.info(`installing package ${qualifedPackage}`);
|
||||||
const result = await porcelain.install(qualifedPackage, notifier);
|
const result = await porcelain.install(qualifedPackage, notifier);
|
||||||
console.log(`successfully installed ${qualifedPackage}`, result);
|
log.info(`successfully installed ${qualifedPackage}`, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
function newInstallProgressNotifier(full_name: string, notifyMainWindow: MainWindowNotifier) {
|
function newInstallProgressNotifier(full_name: string, notifyMainWindow: MainWindowNotifier) {
|
||||||
|
|
|
@ -184,12 +184,12 @@ export async function cacheImage(url: string): Promise<string> {
|
||||||
if (!fs.existsSync(imagePath)) {
|
if (!fs.existsSync(imagePath)) {
|
||||||
try {
|
try {
|
||||||
await downloadImage(url, imagePath);
|
await downloadImage(url, imagePath);
|
||||||
console.log("Image downloaded and cached:", imagePath);
|
log.info("Image downloaded and cached:", imagePath);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Failed to download image:", error);
|
log.error("Failed to download image:", error);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
console.log("Image already cached:", imagePath);
|
log.info("Image already cached:", imagePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
return `file://${imagePath}`;
|
return `file://${imagePath}`;
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
.sort((a, b) => {
|
.sort((a, b) => {
|
||||||
return a.manual_sorting - b.manual_sorting;
|
return a.manual_sorting - b.manual_sorting;
|
||||||
});
|
});
|
||||||
console.log("test", packages);
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="relative h-full w-full">
|
<div class="relative h-full w-full">
|
||||||
|
|
|
@ -3,6 +3,7 @@ import type { Session } from "$libs/types";
|
||||||
import bcrypt from "bcryptjs";
|
import bcrypt from "bcryptjs";
|
||||||
import { getSession } from "$libs/stores/auth";
|
import { getSession } from "$libs/stores/auth";
|
||||||
import { getHeaders } from "@native";
|
import { getHeaders } from "@native";
|
||||||
|
import log from "./logger";
|
||||||
|
|
||||||
export const baseUrl = "https://api.tea.xyz/v1";
|
export const baseUrl = "https://api.tea.xyz/v1";
|
||||||
|
|
||||||
|
@ -10,7 +11,7 @@ export async function get<T>(
|
||||||
urlPath: string,
|
urlPath: string,
|
||||||
params?: { [key: string]: string }
|
params?: { [key: string]: string }
|
||||||
): Promise<T | null> {
|
): Promise<T | null> {
|
||||||
console.log(`GET /v1/${urlPath}`);
|
log.info(`GET /v1/${urlPath}`);
|
||||||
|
|
||||||
const headers = await getHeaders(`GET/${urlPath}`);
|
const headers = await getHeaders(`GET/${urlPath}`);
|
||||||
delete headers["User-Agent"]; // this is in the browser, not allowed to modify UserAgent
|
delete headers["User-Agent"]; // this is in the browser, not allowed to modify UserAgent
|
||||||
|
|
Loading…
Reference in a new issue