Log a message
   +watch+ is the String name of the Watch (may be nil if not Watch is applicable)
   +level+ is the log level [:debug|:info|:warn|:error|:fatal]
   +text+ is the String message

 Returns nothing
962939
def log(watch, level, text)
      # initialize watch log if necessary
      self.logs[watch.name] ||= Timeline.new(God::LOG_BUFFER_SIZE_DEFAULT) if watch

      # push onto capture and timeline for the given watch
      if @capture || (watch && (Time.now - @spool < 2))
        @mutex.synchronize do
          @templogio.truncate(0)
          @templogio.rewind
          @templog.send(level, text)

          message = @templogio.string.dup

          if @capture
            @capture.puts(message)
          else
            self.logs[watch.name] << [Time.now, message]
          end
        end
      end

      # send to regular logger
      self.send(level, text)

      # send to syslog
      SysLogger.log(level, text) if Logger.syslog
    end
557438
def log(message, type = nil)
      unless Alchemy::Shell.silenced?
        case type
        when :skip
          puts "#{color(:yellow)}== Skipping! #{message}#{color(:clear)}"
        when :error
          puts "#{color(:red)}!! ERROR: #{message}#{color(:clear)}"
        when :message
          puts "#{color(:clear)}#{message}"
        else
          puts "#{color(:green)}== #{message}#{color(:clear)}"
        end
      end
    end
167341
def log(program, message, exit_status = nil, files = nil)
      File.open(File.join(@log_directory, @log_file), "a") do |log|
        log.puts ""
        log.puts Time.now.to_s + " " + program
        log.puts message
        log.puts ""
      end

      if exit_status
        remove_files(files) unless files.nil?
        exit exit_status.to_i
      end
    end
835274
def log(message)
      if verbose
        puts "*** #{message}"
      elsif very_verbose
        time = Time.now.strftime('%H:%M:%S %Y-%m-%d')
        puts "** [#{time}] #$$: #{message}"
      end
    end
303695
def log_internal(level, index, message = nil, payload = nil, exception = nil)
      # Exception being logged?
      if exception.nil? && payload.nil? && message.respond_to?(:backtrace) && message.respond_to?(:message)
        exception = message
        message   = nil
      elsif exception.nil? && payload && payload.respond_to?(:backtrace) && payload.respond_to?(:message)
        exception = payload
        payload   = nil
      end

      # Add result of block as message or payload if not nil
      if block_given? && (result = yield)
        if result.is_a?(String)
          message = message.nil? ? result : "#{message} -- #{result}"
        elsif message.nil? && result.is_a?(Hash)
          message = result
        elsif payload && payload.respond_to?(:merge) # rubocop: disable Style/SafeNavigation
          payload.merge(result)
        else
          payload = result
        end
      end

      # Add scoped payload
      if self.payload
        payload = payload.nil? ? self.payload : self.payload.merge(payload)
      end

      merged_tags = merge_tags_with_payload(payload)
      # Add caller stack trace
      backtrace = extract_backtrace if index >= Sapience.config.backtrace_level_index

      log = Log.new(level, Thread.current.name, name, message, payload, Time.now, nil, merged_tags, index, exception, nil, backtrace)

      # Logging Hash only?
      # logger.info(name: 'value')

      if payload.nil? && exception.nil? && message.is_a?(Hash)
        payload           = message.dup
        min_duration      = payload.delete(:min_duration) || 0.0
        log.exception     = payload.delete(:exception)
        log.message       = payload.delete(:message)
        log.metric        = payload.delete(:metric)
        log.metric_amount = payload.delete(:metric_amount) || 1
        if (duration = payload.delete(:duration))
          return false if duration <= min_duration
          log.duration = duration
        end
        log.payload = payload unless payload.empty?
      end
      self.log(log) if include_message?(log)
    end
112927
def log(message, level="info"):
    
    now = time.time()
    entry = {}
    entry['level'] = level
    entry['message'] = message
    entry['timestamp'] = now
    _log_entries.append(entry)
785691
def log_handler(level: str, message: str) -> None:
    """"""
    message = 'JS: ' + str(message)
    if level == 'error':
        logger.error(message)
    elif level == 'warn':
        logger.warning(message)
    elif level == 'info':
        logger.info(message)
    elif level == 'debug':
        logger.debug(message)
929783
def LogMsg(msg):
	

	global headerlogged

	if headerlogged == 0:
		print("{0:<8} {1:<90} {2}".format(
			"Time",
			"MainThread",
			"UpdateSNMPObjsThread"
		))
		print("{0:-^120}".format("-"))
		headerlogged = 1

	threadname = threading.currentThread().name

	funcname = sys._getframe(1).f_code.co_name
	if funcname == "<module>":
		funcname = "Main code path"
	elif funcname == "LogNetSnmpMsg":
		funcname = "net-snmp code"
	else:
		funcname = "{0}()".format(funcname)

	if threadname == "MainThread":
		logmsg = "{0} {1:<112.112}".format(
			time.strftime("%T", time.localtime(time.time())),
			"{0}: {1}".format(funcname, msg)
		)
	else:
		logmsg = "{0} {1:>112.112}".format(
			time.strftime("%T", time.localtime(time.time())),
			"{0}: {1}".format(funcname, msg)
		)
	print(logmsg)
333506
def showMessage(self, level, message):
        
        self.uiFeedbackLBL.setText(message)
        self.uiLoggerEDIT.log(level, message)
479059
def log(msg, level=0):
    '''
    
    '''

    red = '\033[91m'
    endc = '\033[0m'

    # configure the logging module
    cfg = {
        'version': 1,
        'disable_existing_loggers': False,
        'formatters': {
            'stdout': {
                'format': '[%(levelname)s]: %(asctime)s - %(message)s',
                'datefmt': '%x %X'
            },
            'stderr': {
                'format': red + '[%(levelname)s]: %(asctime)s - %(message)s' + endc,
                'datefmt': '%x %X'
            }
        },
        'handlers': {
            'stdout': {
                'class': 'logging.StreamHandler',
                'level': 'DEBUG',
                'formatter': 'stdout'
            },
            'stderr': {
                'class': 'logging.StreamHandler',
                'level': 'ERROR',
                'formatter': 'stderr'
            }
        },
        'loggers': {
            'info': {
                'handlers': ['stdout'],
                'level': 'INFO',
                'propagate': True
            },
            'error': {
                'handlers': ['stderr'],
                'level': 'ERROR',
                'propagate': False
            }
        }
    }

    dictConfig(cfg)

    lg = 'info' if level == 0 else 'error'
    lvl = 20 if level == 0 else 40

    logger = logging.getLogger(lg)
    logger.log(lvl, msg)
1041192
def log_message(self, msg, *args):
        """"""
        if args:
            msg = msg % args
        self.logger.info(msg)
180735
function log(level, message, stackLevel) {
  //	util.log("log: " + level + " : " + message);		
  var index = log_types.indexOf(level);
  if (index <= log_level) {
//    console.log( typeof message)
    if (typeof message !== 'string') {
      if( message instanceof Error) {
        message = message.toString();
      } else {
        message = JSON.stringify(message);
      }
    }

    if (index == 1) message = "*** " + message;

    if (__stack) {
      var ref = __stack[2];
      var line = ref.getLineNumber();
      var name = ref.getFileName().replace(process.cwd() + '/', '');
      message = "(" + name + ":" + line + "): " + message;

    }

    util.log(log_labels[index] + ' ' + message);
  }
}
1175615
def log_events
      logger = Logging.logger[target.name]
      if (logs = value.dig('report', 'logs'))
        logs.each do |log|
          case log["level"]
          when 'err'
            logger.error(log['message'])
          when 'warn'
            logger.info(log['message'])
          when 'notice'
            logger.notice(log['message'])
          when 'info'
            logger.info(log['message'])
          else
            logger.debug(log["message"])
          end
        end
      end
    end
714757
def my_log_message(verbose, prio, msg):
    
    syslog.syslog(prio, msg)
    if verbose or prio == syslog.LOG_ERR:
        sys.stderr.write("%s\n" % (msg))
1037433
def info(self, message):
        '''
        
        '''
        return self._log(
            message=message.upper(),
            stream=sys.stdout
        )
237039
def log(self, message, level=LOG_INFO):
        
        assert level in [
            self.LOG_ERROR,
            self.LOG_INFO,
            self.LOG_WARNING,
        ], "level must be LOG_ERROR, LOG_INFO or LOG_WARNING"

        # nicely format logs if we can using pretty print
        if isinstance(message, (dict, list, set, tuple)):
            message = pformat(message)
        # start on new line if multi-line output
        try:
            if "\n" in message:
                message = "\n" + message
        except:  # noqa e722
            pass
        message = "Module `{}`: {}".format(self._module.module_full_name, message)
        self._py3_wrapper.log(message, level)
745458
def debug(message, level=1):
    
    if level <= debug_level:
        logging.debug(' ' * (level - 1) * 2 + str(message))