mirror of
				https://github.com/esphome/esphome.git
				synced 2025-11-04 09:01:49 +00:00 
			
		
		
		
	Merge branch 'logger_check_outside_func' into integration
This commit is contained in:
		@@ -1360,9 +1360,6 @@ void APIConnection::update_command(const UpdateCommandRequest &msg) {
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
bool APIConnection::try_send_log_message(int level, const char *tag, const char *line, size_t message_len) {
 | 
			
		||||
  if (this->flags_.log_subscription < level)
 | 
			
		||||
    return false;
 | 
			
		||||
 | 
			
		||||
  // Pre-calculate message size to avoid reallocations
 | 
			
		||||
  uint32_t msg_size = 0;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -209,6 +209,7 @@ class APIConnection : public APIServerConnection {
 | 
			
		||||
    return static_cast<ConnectionState>(this->flags_.connection_state) == ConnectionState::CONNECTED ||
 | 
			
		||||
           this->is_authenticated();
 | 
			
		||||
  }
 | 
			
		||||
  uint8_t get_log_subscription_level() const { return this->flags_.log_subscription; }
 | 
			
		||||
  void on_fatal_error() override;
 | 
			
		||||
  void on_unauthenticated_access() override;
 | 
			
		||||
  void on_no_setup_connection() override;
 | 
			
		||||
 
 | 
			
		||||
@@ -105,7 +105,7 @@ void APIServer::setup() {
 | 
			
		||||
            return;
 | 
			
		||||
          }
 | 
			
		||||
          for (auto &c : this->clients_) {
 | 
			
		||||
            if (!c->flags_.remove)
 | 
			
		||||
            if (!c->flags_.remove && c->get_log_subscription_level() >= level)
 | 
			
		||||
              c->try_send_log_message(level, tag, message, message_len);
 | 
			
		||||
          }
 | 
			
		||||
        });
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user