Skip to content

Commit

Permalink
Move verbose log lines to silly level (#859)
Browse files Browse the repository at this point in the history
Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
  • Loading branch information
nevalla committed Sep 11, 2020
1 parent b67575d commit 77895d4
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/common/base-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,15 @@ export class BaseStore<T = any> extends Singleton {
);
if (ipcMain) {
const callback = (event: IpcMainEvent, model: T) => {
logger.debug(`[STORE]: SYNC ${this.name} from renderer`, { model });
logger.silly(`[STORE]: SYNC ${this.name} from renderer`, { model });
this.onSync(model);
};
ipcMain.on(this.syncChannel, callback);
this.syncDisposers.push(() => ipcMain.off(this.syncChannel, callback));
}
if (ipcRenderer) {
const callback = (event: IpcRendererEvent, model: T) => {
logger.debug(`[STORE]: SYNC ${this.name} from main`, { model });
logger.silly(`[STORE]: SYNC ${this.name} from main`, { model });
this.onSync(model);
};
ipcRenderer.on(this.syncChannel, callback);
Expand Down
2 changes: 1 addition & 1 deletion src/common/cluster-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export class ClusterStore extends BaseStore<ClusterStoreModel> {
if (ipcRenderer) {
ipcRenderer.on("cluster:state", (event, model: ClusterState) => {
this.applyWithoutSync(() => {
logger.debug(`[CLUSTER-STORE]: received push-state at ${location.host}`, model);
logger.silly(`[CLUSTER-STORE]: received push-state at ${location.host}`, model);
this.getById(model.id)?.updateModel(model);
})
})
Expand Down
2 changes: 1 addition & 1 deletion src/common/ipc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export function broadcastIpc({ channel, frameId, frameOnly, webContentId, filter
}
views.forEach(webContent => {
const type = webContent.getType();
logger.debug(`[IPC]: broadcasting "${channel}" to ${type}=${webContent.id}`, { args });
logger.silly(`[IPC]: broadcasting "${channel}" to ${type}=${webContent.id}`, { args });
if (!frameOnly) {
webContent.send(channel, ...args);
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ export class Cluster implements ClusterModel {
}

pushState = (state = this.getState()): ClusterState => {
logger.debug(`[CLUSTER]: push-state`, state);
logger.silly(`[CLUSTER]: push-state`, state);
broadcastIpc({
channel: "cluster:state",
frameId: this.frameId,
Expand Down
6 changes: 4 additions & 2 deletions src/main/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@ import { app, remote } from "electron";
import winston from "winston"
import { isDebugging } from "../common/vars";

const logLevel = process.env.LOG_LEVEL ? process.env.LOG_LEVEL : isDebugging ? "debug" : "info"

const consoleOptions: winston.transports.ConsoleTransportOptions = {
handleExceptions: false,
level: isDebugging ? "debug" : "info",
level: logLevel,
}

const fileOptions: winston.transports.FileTransportOptions = {
handleExceptions: false,
level: isDebugging ? "debug" : "info",
level: logLevel,
filename: "lens.log",
dirname: (app ?? remote?.app)?.getPath("logs"),
maxsize: 16 * 1024,
Expand Down

0 comments on commit 77895d4

Please sign in to comment.