42 // Function for listeners
43 typedef void (*UpdateListenerFunction)(void);
44
45 // Register callback for config change.
46 // The callback is always called with ConfigurationLock held,
47 // hence doing log reconfiguration from the callback will deadlock.
48 // The main Java thread may call this callback if there is an early registration
49 // else the attach listener JavaThread, started via diagnostic command, will be executing thread.
50 // The main purpose of this callback is to see if a loglevel have been changed.
51 // There is no way to unregister.
52 static void register_update_listener(UpdateListenerFunction cb);
53
54 private:
55 static LogOutput** _outputs;
56 static size_t _n_outputs;
57
58 static UpdateListenerFunction* _listener_callbacks;
59 static size_t _n_listener_callbacks;
60
61 // Create a new output. Returns NULL if failed.
62 static LogOutput* new_output(char* name, const char* options, outputStream* errstream);
63
64 // Add an output to the list of configured outputs. Returns the assigned index.
65 static size_t add_output(LogOutput* out);
66
67 // Delete a configured output. The stderr/stdout outputs can not be removed.
68 // Output should be completely disabled before it is deleted.
69 static void delete_output(size_t idx);
70
71 // Disable all logging to the specified output and then delete it (unless it is stdout/stderr).
72 static void disable_output(size_t idx);
73
74 // Get output index by name. Returns SIZE_MAX if output not found.
75 static size_t find_output(const char* name);
76
77 // Configure output (add or update existing configuration) to log on tag-level combination using specified decorators.
78 static void configure_output(size_t idx, const LogTagLevelExpression& tag_level_expression, const LogDecorators& decorators);
79
80 // This should be called after any configuration change while still holding ConfigurationLock
81 static void notify_update_listeners();
82
|
42 // Function for listeners
43 typedef void (*UpdateListenerFunction)(void);
44
45 // Register callback for config change.
46 // The callback is always called with ConfigurationLock held,
47 // hence doing log reconfiguration from the callback will deadlock.
48 // The main Java thread may call this callback if there is an early registration
49 // else the attach listener JavaThread, started via diagnostic command, will be executing thread.
50 // The main purpose of this callback is to see if a loglevel have been changed.
51 // There is no way to unregister.
52 static void register_update_listener(UpdateListenerFunction cb);
53
54 private:
55 static LogOutput** _outputs;
56 static size_t _n_outputs;
57
58 static UpdateListenerFunction* _listener_callbacks;
59 static size_t _n_listener_callbacks;
60
61 // Create a new output. Returns NULL if failed.
62 static LogOutput* new_output(const char* name, const char* options, outputStream* errstream);
63
64 // Add an output to the list of configured outputs. Returns the assigned index.
65 static size_t add_output(LogOutput* out);
66
67 // Delete a configured output. The stderr/stdout outputs can not be removed.
68 // Output should be completely disabled before it is deleted.
69 static void delete_output(size_t idx);
70
71 // Disable all logging to the specified output and then delete it (unless it is stdout/stderr).
72 static void disable_output(size_t idx);
73
74 // Get output index by name. Returns SIZE_MAX if output not found.
75 static size_t find_output(const char* name);
76
77 // Configure output (add or update existing configuration) to log on tag-level combination using specified decorators.
78 static void configure_output(size_t idx, const LogTagLevelExpression& tag_level_expression, const LogDecorators& decorators);
79
80 // This should be called after any configuration change while still holding ConfigurationLock
81 static void notify_update_listeners();
82
|