1
- import type { Maybe } from '../types.js' ;
2
-
3
1
/**
4
2
* Originally, I used the `electron-log` module (https://github.com/megahertz/electron-log)
5
3
* but at some point it stopped writing logs from renderer to a file.
@@ -25,32 +23,19 @@ export type LogMessage = LogData & {
25
23
} ;
26
24
27
25
/**
28
- * Formats log messages into strings to be written to transporters.
29
- * Return `undefined` to skip logging the message.
30
- */
31
- export interface LogFormatter {
32
- format ( message : LogMessage ) : Maybe < string > ;
33
- }
34
-
35
- /**
36
- * Transporters write formatted messages somewhere.
37
- * For example, to the console, a file, an api, or nowhere.
38
- * What the string looks like is up to the formatter.
26
+ * Transporters write log messages somewhere.
27
+ * For example, to a console, a file, an api, or nowhere.
39
28
*/
40
29
export interface LogTransporter {
41
- transport ( message : string ) : void ;
30
+ transport ( message : LogMessage ) : void ;
42
31
}
43
32
44
33
export interface LogTransportConfig {
45
34
/**
46
- * Transports formatted log lines somewhere.
47
- * Could write them to a console, to a file, or ship to a remote system .
35
+ * Transports log messages somewhere.
36
+ * For example, to the console, a file, an api, or nowhere .
48
37
*/
49
38
transporter : LogTransporter ;
50
- /**
51
- * Formats log data objects into strings to write to the transporter.
52
- */
53
- formatter : LogFormatter ;
54
39
/**
55
40
* By default, all messages are logged to every transporter for levels
56
41
* that satisify the runtime log level. You can further restrict which
0 commit comments