mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
* Update CRD api to use preferred version and implement v1 differences Signed-off-by: Trevor Nichols <trevor@nichols.id.au> * Fix unit test failure Signed-off-by: Trevor Nichols <trevor@nichols.id.au> * Register alternate API base URL if preferred version changes. Signed-off-by: Trevor Nichols <trevor@nichols.id.au> * Adjust for validation moving to the version.schema Signed-off-by: Trevor Nichols <trevor@nichols.id.au>
32 lines
804 B
TypeScript
32 lines
804 B
TypeScript
import { app, remote } from "electron";
|
|
import winston from "winston"
|
|
import { isDebugging } from "../common/vars";
|
|
|
|
const consoleOptions: winston.transports.ConsoleTransportOptions = {
|
|
handleExceptions: false,
|
|
level: isDebugging ? "debug" : "info",
|
|
}
|
|
|
|
const fileOptions: winston.transports.FileTransportOptions = {
|
|
handleExceptions: false,
|
|
level: isDebugging ? "debug" : "info",
|
|
filename: "lens.log",
|
|
dirname: (app ?? remote?.app)?.getPath("logs"),
|
|
maxsize: 16 * 1024,
|
|
maxFiles: 16,
|
|
tailable: true,
|
|
}
|
|
|
|
const logger = winston.createLogger({
|
|
format: winston.format.combine(
|
|
winston.format.colorize(),
|
|
winston.format.simple(),
|
|
),
|
|
transports: [
|
|
new winston.transports.Console(consoleOptions),
|
|
new winston.transports.File(fileOptions),
|
|
],
|
|
});
|
|
|
|
export default logger
|