summaryrefslogtreecommitdiff
path: root/modules/esm/console.js
diff options
context:
space:
mode:
authorPhilip Chimento <philip.chimento@gmail.com>2023-03-05 18:26:25 +0000
committerPhilip Chimento <philip.chimento@gmail.com>2023-03-05 18:26:25 +0000
commitad36414e00d4d9c1b0160e1ec3041fd1607dcd77 (patch)
treeb9ece2e1fda25100814480aaea1c21cf0701bdd4 /modules/esm/console.js
parent12de7257e2923c5285614d51f06d751ebc0c60a8 (diff)
parent52adc35e38b2475fd6468982bb9ed31d50304f36 (diff)
downloadgjs-ad36414e00d4d9c1b0160e1ec3041fd1607dcd77.tar.gz
Merge branch 'february-maintenance' into 'master'
February maintenance See merge request GNOME/gjs!828
Diffstat (limited to 'modules/esm/console.js')
-rw-r--r--modules/esm/console.js12
1 files changed, 5 insertions, 7 deletions
diff --git a/modules/esm/console.js b/modules/esm/console.js
index 74a34666..1532624d 100644
--- a/modules/esm/console.js
+++ b/modules/esm/console.js
@@ -1,9 +1,6 @@
// SPDX-License-Identifier: MIT OR LGPL-2.0-or-later
// SPDX-FileCopyrightText: 2021 Evan Welsh <contact@evanwelsh.com>
-import GLib from 'gi://GLib';
-import GjsPrivate from 'gi://GjsPrivate';
-
const DEFAULT_LOG_DOMAIN = 'Gjs-Console';
// A line-by-line implementation of https://console.spec.whatwg.org/.
@@ -112,7 +109,7 @@ class Console {
*/
clear() {
this.#groupIndentation = '';
- GjsPrivate.clear_terminal();
+ imports.gi.GjsPrivate.clear_terminal();
}
/**
@@ -268,7 +265,7 @@ class Console {
* @returns {void}
*/
time(label) {
- this.#timeLabels[label] = GLib.get_monotonic_time();
+ this.#timeLabels[label] = imports.gi.GLib.get_monotonic_time();
}
/**
@@ -288,7 +285,7 @@ class Console {
`No time log found for label: '${label}'.`,
]);
} else {
- const durationMs = (GLib.get_monotonic_time() - startTime) / 1000;
+ const durationMs = (imports.gi.GLib.get_monotonic_time() - startTime) / 1000;
const concat = `${label}: ${durationMs.toFixed(3)} ms`;
data.unshift(concat);
@@ -314,7 +311,7 @@ class Console {
} else {
delete this.#timeLabels[label];
- const durationMs = (GLib.get_monotonic_time() - startTime) / 1000;
+ const durationMs = (imports.gi.GLib.get_monotonic_time() - startTime) / 1000;
const concat = `${label}: ${durationMs.toFixed(3)} ms`;
this.#printer('timeEnd', [concat]);
@@ -500,6 +497,7 @@ class Console {
* @returns {void}
*/
#printer(logLevel, args, options) {
+ const GLib = imports.gi.GLib;
let severity;
switch (logLevel) {