-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathlogger.stub.php
More file actions
143 lines (133 loc) · 4.16 KB
/
Copy pathlogger.stub.php
File metadata and controls
143 lines (133 loc) · 4.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<?php
/**
* @generate-function-entries
* @generate-legacy-arginfo
*/
/**
* Initialize the ValkeyGlide logger if it wasn't initialized before.
*
* This function matches Node.js Logger.init() behavior - it configures the logger
* only if it wasn't previously configured. The logger will be used by all components
* (PHP, C extension, and Rust core) for unified logging.
*
* @param string|null $level Log level: "error", "warn", "info", "debug", "trace", "off"
* If null, defaults to "warn"
* @param string|null $filename Optional filename for file logging. If null, logs to console
* @return bool True on success, false on error
*
* @see https://github.com/valkey-io/valkey-glide/blob/main/node/src/Logger.ts
*/
function valkey_glide_logger_init(?string $level = null, ?string $filename = null): bool
{
}
/**
* Set/replace the logger configuration.
*
* This function matches Node.js Logger.setLoggerConfig() behavior - it replaces
* the existing configuration, meaning new logs will not be saved with logs sent
* before the call. The previous logs will remain unchanged.
*
* @param string $level Log level: "error", "warn", "info", "debug", "trace", "off"
* @param string|null $filename Optional filename for file logging. If null, logs to console
* @return bool True on success, false on error
*
* @see https://github.com/valkey-io/valkey-glide/blob/main/node/src/Logger.ts
*/
function valkey_glide_logger_set_config(string $level, ?string $filename = null): bool
{
}
/**
* Log a message from PHP code.
*
* This function matches Node.js Logger.log() behavior. It will automatically
* initialize the logger with default configuration if not already initialized.
*
* @param string $level Log level: "error", "warn", "info", "debug", "trace"
* @param string $identifier Context identifier for the log message
* @param string $message The log message content
* @return void
*
* @see https://github.com/valkey-io/valkey-glide/blob/main/node/src/Logger.ts
*/
function valkey_glide_logger_log(string $level, string $identifier, string $message): void
{
}
/**
* Log an error message from PHP code.
*
* Convenience function that matches Node.js Logger.error() behavior.
* Automatically initializes logger if needed.
*
* @param string $identifier Context identifier for the log message
* @param string $message The error message content
* @return void
*/
function valkey_glide_logger_error(string $identifier, string $message): void
{
}
/**
* Log a warning message from PHP code.
*
* Convenience function that matches Node.js Logger.warn() behavior.
* Automatically initializes logger if needed.
*
* @param string $identifier Context identifier for the log message
* @param string $message The warning message content
* @return void
*/
function valkey_glide_logger_warn(string $identifier, string $message): void
{
}
/**
* Log an info message from PHP code.
*
* Convenience function that matches Node.js Logger.info() behavior.
* Automatically initializes logger if needed.
*
* @param string $identifier Context identifier for the log message
* @param string $message The info message content
* @return void
*/
function valkey_glide_logger_info(string $identifier, string $message): void
{
}
/**
* Log a debug message from PHP code.
*
* Convenience function that matches Node.js Logger.debug() behavior.
* Automatically initializes logger if needed.
*
* @param string $identifier Context identifier for the log message
* @param string $message The debug message content
* @return void
*/
function valkey_glide_logger_debug(string $identifier, string $message): void
{
}
/**
* Check if the logger has been initialized.
*
* Used to implement Node.js-style initialization behavior where the first
* log attempt initializes the logger with default configuration.
*
* @return bool True if logger is initialized, false otherwise
*/
function valkey_glide_logger_is_initialized(): bool
{
}
/**
* Get the current log level as an integer.
*
* Returns the current log level:
* - 0 = Error
* - 1 = Warn
* - 2 = Info
* - 3 = Debug
* - 4 = Trace
* - 5 = Off
*
* @return int Current log level constant
*/
function valkey_glide_logger_get_level(): int
{
}