anchor.diff:  }).
   -type record() :: #atm_workflow_execution_logger{}.
   
  --export_type([record/0]).
  +-export_type([severity/0, entry/0, log/0, record/0]).
   
   
   %%%===================================================================
  
positive.code:     }.
  
  
  -spec task_debug(entry(), record()) -> ok.
  task_debug(Entry, AtmWorkflowExecutionLogger) ->
      task_append_log(Entry, ?LOGGER_DEBUG, AtmWorkflowExecutionLogger).
  
  
  -spec task_info(entry(), record()) -> ok.
  task_info(Entry, AtmWorkflowExecutionLogger) ->
      task_append_log(Entry, ?LOGGER_INFO, AtmWorkflowExecutionLogger).
  
  
  -spec task_notice(entry(), record()) -> ok.
  task_notice(Entry, AtmWorkflowExecutionLogger) ->
      task_append_log(Entry, ?LOGGER_NOTICE, AtmWorkflowExecutionLogger).
  
  
  -spec task_warning(entry(), record()) -> ok.
  task_warning(Entry, AtmWorkflowExecutionLogger) ->
      task_append_log(Entry, ?LOGGER_WARNING, AtmWorkflowExecutionLogger).
  
  
  -spec task_alert(entry(), record()) -> ok.
  task_alert(Entry, AtmWorkflowExecutionLogger) ->
      task_append_log(Entry, ?LOGGER_ALERT, AtmWorkflowExecutionLogger).
  
  
  -spec task_error(entry(), record()) -> ok.
  task_error(Entry, AtmWorkflowExecutionLogger) ->
      task_append_log(Entry, ?LOGGER_ERROR, AtmWorkflowExecutionLogger).
  
  
  -spec task_critical(entry(), record()) -> ok.
  task_critical(Entry, AtmWorkflowExecutionLogger) ->
      task_append_log(Entry, ?LOGGER_CRITICAL, AtmWorkflowExecutionLogger).
  
  
  -spec task_emergency(entry(), record()) -> ok.
  task_emergency(Entry, AtmWorkflowExecutionLogger) ->
      task_append_log(Entry, ?LOGGER_EMERGENCY, AtmWorkflowExecutionLogger).
  
  
  -spec workflow_debug(entry(), record()) -> ok.
  workflow_debug(Entry, AtmWorkflowExecutionLogger) ->
      workflow_append_log(Entry, ?LOGGER_DEBUG, AtmWorkflowExecutionLogger).
  
  
  -spec workflow_info(entry(), record()) -> ok.
  workflow_info(Entry, AtmWorkflowExecutionLogger) ->
      workflow_append_log(Entry, ?LOGGER_INFO, AtmWorkflowExecutionLogger).
  
  
  -spec workflow_notice(entry(), record()) -> ok.
  workflow_notice(Entry, AtmWorkflowExecutionLogger) ->
      workflow_append_log(Entry, ?LOGGER_NOTICE, AtmWorkflowExecutionLogger).
  
  
  -spec workflow_warning(entry(), record()) -> ok.
  workflow_warning(Entry, AtmWorkflowExecutionLogger) ->
      workflow_append_log(Entry, ?LOGGER_WARNING, AtmWorkflowExecutionLogger).
  
  
  -spec workflow_alert(entry(), record()) -> ok.
  workflow_alert(Entry, AtmWorkflowExecutionLogger) ->
      workflow_append_log(Entry, ?LOGGER_ALERT, AtmWorkflowExecutionLogger).
  
  
  -spec workflow_error(entry(), record()) -> ok.
  workflow_error(Entry, AtmWorkflowExecutionLogger) ->
      workflow_append_log(Entry, ?LOGGER_ERROR, AtmWorkflowExecutionLogger).
  
  
  -spec workflow_critical(entry(), record()) -> ok.
  workflow_critical(Entry, AtmWorkflowExecutionLogger) ->
      workflow_append_log(Entry, ?LOGGER_CRITICAL, AtmWorkflowExecutionLogger).
  
  
  -spec workflow_emergency(entry(), record()) -> ok.
  workflow_emergency(Entry, AtmWorkflowExecutionLogger) ->
      workflow_append_log(Entry, ?LOGGER_EMERGENCY, AtmWorkflowExecutionLogger).
  
  
  %%%===================================================================
  
negative.code: 
  
  %% @private
  -spec task_append_system_log(entry(), severity(), record()) -> ok.
  task_append_system_log(Entry, Severity, AtmWorkflowExecutionLogger) ->
      SystemLog = ensure_system_audit_log_object(Entry, Severity),
      task_append_log(SystemLog, AtmWorkflowExecutionLogger).
  
  
  %% @private
  -spec workflow_append_system_log(entry(), severity(), record()) -> ok.
  workflow_append_system_log(Entry, Severity, AtmWorkflowExecutionLogger) ->
      SystemLog = ensure_system_audit_log_object(Entry, Severity),
      workflow_append_log(SystemLog, AtmWorkflowExecutionLogger).
  
  
  %% @private
  -spec ensure_system_audit_log_object(entry(), severity()) -> log().
  ensure_system_audit_log_object(Entry, Severity) when is_map(Entry) ->
      Entry#{<<"severity">> => Severity};
  ensure_system_audit_log_object(Entry, Severity) when is_binary(Entry) ->
      #{<<"severity">> => Severity, <<"entry">> => #{<<"description">> => Entry}}.
  
  
  %% @private
  -spec append_log(
      log(),
      atm_workflow_execution_auth:record(),
      undefined | atm_store_container:record()
  ) ->
      ok.
  append_log(_AuditLogObject, _AtmWorkflowExecutionAuth, undefined) ->
      ok;
  append_log(AuditLogObject, AtmWorkflowExecutionAuth, AtmAuditLogStoreContainer) ->
      Operation = #atm_store_container_operation{
          type = append,
          options = #{},
          argument = AuditLogObject,
          workflow_execution_auth = AtmWorkflowExecutionAuth
      },
      catch atm_audit_log_store_container:apply_operation(AtmAuditLogStoreContainer, Operation),
      ok.
  