Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Centralized logger implementation #53

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
ccb9984
Initial implementation of logging utilities.
namark Oct 30, 2021
eed3499
Some not implemented warnings logged only once.
namark Oct 30, 2021
2684c9f
Fixed linting errors.
namark Oct 30, 2021
ceddde4
Moved logger test to appropriate directory.
namark Oct 30, 2021
7fd356f
Fixed logger unit test import.
namark Oct 30, 2021
d26cedd
Merge branch 'master' into centralized-logger
namark Nov 13, 2021
da62e84
Fixed new linting errors in logger code.
namark Nov 5, 2021
d9e9462
Minor typos in centralized logger.
namark Nov 13, 2021
76cefe6
Logging levels made available directly through Logger class.
namark Nov 13, 2021
c7429e5
JSDoc fixes in centralized logger.
namark Nov 13, 2021
bd1e00f
Logger exports moved to the bottom of the file.
namark Nov 13, 2021
49eb3ec
Minor rename in centralized logger.
namark Nov 13, 2021
f4c325a
Small simplified in usage of Log in InboundAudioStream.
namark Nov 13, 2021
ffa3992
Major improvements in the centralized logger
namark Nov 19, 2021
ad2b1c6
Small improvements and fixes in centralized logger.
namark Nov 22, 2021
192b124
Added permanent vircadia-sdk tag to main logger instance.
namark Nov 22, 2021
1fe74b1
Logger configuration exported,
namark Nov 22, 2021
97f7723
Moved/renamed logger and its unit tests.
namark Nov 25, 2021
d85dcdf
Added unit tests for the main logger instance.
namark Nov 25, 2021
ebb5683
Fixed centralized logger documentation.
namark Nov 26, 2021
e1c3b38
Unit test for custom loggable interface.
namark Nov 26, 2021
4731f2a
Exposing the various logger contexts to the SDK user.
namark Nov 26, 2021
bebc234
Fixed linting errors in log unit test.
namark Nov 26, 2021
5624eb5
Replaced usage of 'at' function with subscript operator.
namark Nov 26, 2021
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
11 changes: 10 additions & 1 deletion example/interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,19 @@
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//

import { Vircadia, DomainServer, AudioMixer, AvatarMixer, MessageMixer, Uuid } from "../dist/Vircadia.js";
import {
Vircadia,
DefaultLogConfiguration,
namark marked this conversation as resolved.
Show resolved Hide resolved
DomainServer, AudioMixer,
AvatarMixer,
MessageMixer,
Uuid
} from "../dist/Vircadia.js";

(function () {

DefaultLogConfiguration.filter = undefined;
ctrlaltdavid marked this conversation as resolved.
Show resolved Hide resolved

const DEFAULT_URL = "ws://127.0.0.1:40102";

// Shared context.
Expand Down
8 changes: 8 additions & 0 deletions src/Vircadia.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,11 @@ export type { vec3 } from "./domain/shared/Vec3";

export { default as Quat } from "./domain/shared/Quat";
export type { quat } from "./domain/shared/Quat";

export {
DefaultLogConfiguration,
ConsoleLoggerContext,
LogFilterContext,
LoggerContextCombination,
LogReportContext
} from "./shared/Log";
5 changes: 3 additions & 2 deletions src/domain/audio-client/AudioClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import PacketScribe from "../networking/packets/PacketScribe";
import PacketType, { PacketTypeValue } from "../networking/udt/PacketHeaders";
import assert from "../shared/assert";
import ContextManager from "../shared/ContextManager";
import Log from "../../shared/Log";
import Vec3, { vec3 } from "../shared/Vec3";


Expand Down Expand Up @@ -434,7 +435,7 @@ class AudioClient {
#processStreamStatsPacket = (message: ReceivedMessage, sendingNode: Node | null): void => { // eslint-disable-line
// C++ void AudioIOStats::processStreamStatsPacket(ReceivedMessage*, Node* sendingNode)

console.warn("AudioClient: AudioStreamStats packet not processed.");
Log.one.warning("AudioClient: AudioStreamStats packet not processed.");

// WEBRTC TODO: Address further C++ code.

Expand All @@ -446,7 +447,7 @@ class AudioClient {
#handleAudioEnvironmentDataPacket = (message: ReceivedMessage): void => { // eslint-disable-line
// C++ void handleAudioEnvironmentDataPacket(ReceivedMessage* message)

console.warn("AudioClient: AudioEnvironment packet not processed.");
Log.one.warning("AudioClient: AudioEnvironment packet not processed.");

// WEBRTC TODO: Address further C++ code.

Expand Down
3 changes: 2 additions & 1 deletion src/domain/audio/InboundAudioStream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { SilentAudioFrameDetails } from "../networking/packets/SilentAudioFrame"
import PacketType from "../networking/udt/PacketHeaders";
import UDT from "../networking/udt/UDT";
import ContextManager from "../shared/ContextManager";
import Log from "../../shared/Log";


/*@devdoc
Expand Down Expand Up @@ -124,7 +125,7 @@ class InboundAudioStream {
// C++ int writeDroppableSilentFrames(int silentFrames)

// WEBRTC TODO: Address further C++ code.
console.warn("InboundAudioStream.#writeDroppableSilentFrames() not implemented. Frames:", silentFrames);
Log.one.warning("InboundAudioStream.#writeDroppableSilentFrames() not implemented. Frames:", silentFrames);

}

Expand Down
Loading