fix logging (#666)

This commit is contained in:
ABevier 2023-06-15 11:49:58 -04:00 committed by GitHub
parent e9b5253e3e
commit 6b9d4ec1d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 7 deletions

View file

@ -6,7 +6,7 @@ import { hooks } from "@teaxyz/lib";
import log from "./logger";
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";
export async function installPackage(
@ -19,7 +19,7 @@ export async function installPackage(
const qualifedPackage = `${full_name}@${version}`;
log.info(`installing package ${qualifedPackage}`);
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) {

View file

@ -184,12 +184,12 @@ export async function cacheImage(url: string): Promise<string> {
if (!fs.existsSync(imagePath)) {
try {
await downloadImage(url, imagePath);
console.log("Image downloaded and cached:", imagePath);
log.info("Image downloaded and cached:", imagePath);
} catch (error) {
console.error("Failed to download image:", error);
log.error("Failed to download image:", error);
}
} else {
console.log("Image already cached:", imagePath);
log.info("Image already cached:", imagePath);
}
return `file://${imagePath}`;

View file

@ -21,7 +21,6 @@
.sort((a, b) => {
return a.manual_sorting - b.manual_sorting;
});
console.log("test", packages);
</script>
<div class="relative h-full w-full">

View file

@ -3,6 +3,7 @@ import type { Session } from "$libs/types";
import bcrypt from "bcryptjs";
import { getSession } from "$libs/stores/auth";
import { getHeaders } from "@native";
import log from "./logger";
export const baseUrl = "https://api.tea.xyz/v1";
@ -10,7 +11,7 @@ export async function get<T>(
urlPath: string,
params?: { [key: string]: string }
): Promise<T | null> {
console.log(`GET /v1/${urlPath}`);
log.info(`GET /v1/${urlPath}`);
const headers = await getHeaders(`GET/${urlPath}`);
delete headers["User-Agent"]; // this is in the browser, not allowed to modify UserAgent