// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/logger.cpp
// Function: ash::Logger::Logger(ash::Severity)
Logger::Logger(const Severity lvl)
  : ostream(NULL), log(get_target(lvl).c_str(), fstream::out | fstream::app), level(lvl)
{
  char time_now[200];
  time_t t = time(NULL);

  // Get the session_id, if it has already beeen set.
  const char * session_id =
    getenv("ASH_SESSION_ID") ? getenv("ASH_SESSION_ID") : "?";

  // Get the time now.
  struct tm * tmp = localtime(&t);
  if (tmp == NULL) {
    perror("advanced shell history Logger: localtime");
    if (level != FATAL) {
      LOG(FATAL) << "Failed to get localtime on this machine.";  // recurse
    } else {
      log << "SESSION " << session_id << ": " << to_str(level) << ": ";
      return;
    }
  }

  // Get the log date format, if one was specified.
  Config & config = Config::instance();
  string format = config.get_string("LOG_DATE_FMT", "%Y-%m-%d %H:%M:%S %Z: ");
  if (strftime(time_now, sizeof(time_now), format.c_str(), tmp) == 0) {
    if (level != FATAL) {  // avoids infinite recursion.
      LOG(FATAL) << "ASH_CFG_LOG_DATE_FMT is invalid: '" << format << "'";
    } else {
      log << "SESSION " << session_id << ": " << to_str(level) << ": ";
    }
  } else {
    log << time_now << "SESSION " << session_id << ": " << to_str(level)
        << ": ";
  }
}

// Assembly:
subq $0x898, %rsp            # imm = 0x898
movq %rdi, 0x890(%rsp)
movl %esi, 0x88c(%rsp)
movq 0x890(%rsp), %rdi
movq %rdi, 0xc8(%rsp)
addq $0x210, %rdi            # imm = 0x210
callq 0x8160
movq 0xc8(%rsp), %rdi
leaq 0x2e457(%rip), %rsi     # 0xcfc98
xorl %eax, %eax
movl %eax, %edx
callq 0x8620
jmp 0xa184c
movq 0xc8(%rsp), %rax
leaq 0x2e3fd(%rip), %rcx     # 0xcfc58
movq %rcx, (%rax)
leaq 0x2e41b(%rip), %rcx     # 0xcfc80
movq %rcx, 0x210(%rax)
addq $0x8, %rax
movq %rax, 0xc0(%rsp)
movl 0x88c(%rsp), %esi
leaq 0x858(%rsp), %rdi
callq 0xa0d40
jmp 0xa188e
leaq 0x858(%rsp), %rdi
callq 0x8190
movq %rax, 0xb8(%rsp)
jmp 0xa18a5
movl $0x10, %edi
movl $0x1, %esi
callq 0xa2150
movl %eax, 0xb4(%rsp)
jmp 0xa18bd
movl 0xb4(%rsp), %edx
movq 0xb8(%rsp), %rsi
movq 0xc0(%rsp), %rdi
callq 0x84b0
jmp 0xa18db
leaq 0x858(%rsp), %rdi
callq 0x88f8
jmp 0xa18ea
movq 0xc8(%rsp), %rax
movl 0x88c(%rsp), %ecx
movl %ecx, 0x208(%rax)
xorl %eax, %eax
movl %eax, %edi
callq 0x8380
movq %rax, 0x788(%rsp)
leaq 0x10a5f(%rip), %rdi     # 0xb2376
callq 0x8540
cmpq $0x0, %rax
je 0xa1938
leaq 0x10a4d(%rip), %rdi     # 0xb2376
callq 0x8540
movq %rax, 0xa8(%rsp)
jmp 0xa1949
leaq 0xcace(%rip), %rax      # 0xae40d
movq %rax, 0xa8(%rsp)
jmp 0xa1949
movq 0xa8(%rsp), %rax
movq %rax, 0x780(%rsp)
leaq 0x788(%rsp), %rdi
callq 0x82b0
movq %rax, 0x778(%rsp)
cmpq $0x0, 0x778(%rsp)
jne 0xa1b22
leaq 0x113c2(%rip), %rdi     # 0xb2d46
callq 0x8300
jmp 0xa198b
movq 0xc8(%rsp), %rax
cmpl $0x4, 0x208(%rax)
je 0xa1a79
leaq 0x460(%rsp), %rdi
movl $0x4, %esi
callq 0xa1800
jmp 0xa19b4
leaq 0x113b4(%rip), %rsi     # 0xb2d6f
leaq 0x460(%rsp), %rdi
callq 0x945b0
jmp 0xa19ca
leaq 0x460(%rsp), %rdi
callq 0xa1f50
jmp 0xa19d9
jmp 0xa1b20
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x880(%rsp)
movl %eax, 0x87c(%rsp)
jmp 0xa1f16
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x880(%rsp)
movl %eax, 0x87c(%rsp)
jmp 0xa1efe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x880(%rsp)
movl %eax, 0x87c(%rsp)
leaq 0x858(%rsp), %rdi
callq 0x88f8
jmp 0xa1a33
jmp 0xa1efe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x880(%rsp)
movl %eax, 0x87c(%rsp)
jmp 0xa1eed
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x880(%rsp)
movl %eax, 0x87c(%rsp)
leaq 0x460(%rsp), %rdi
callq 0xa1f50
jmp 0xa1a74
jmp 0xa1eed
movq 0xc8(%rsp), %rdi
addq $0x8, %rdi
leaq 0x1130c(%rip), %rsi     # 0xb2d98
callq 0x8400
movq %rax, 0xa0(%rsp)
jmp 0xa1a9b
movq 0xa0(%rsp), %rdi
movq 0x780(%rsp), %rsi
callq 0x8400
movq %rax, 0x98(%rsp)
jmp 0xa1aba
movq 0x98(%rsp), %rdi
leaq 0x12824(%rip), %rsi     # 0xb42ed
callq 0x8400
movq %rax, 0x90(%rsp)
jmp 0xa1ad8
movq 0xc8(%rsp), %rax
movl 0x208(%rax), %edi
callq 0xa0cb0
movq 0x90(%rsp), %rdi
movq %rax, %rsi
callq 0x8400
movq %rax, 0x88(%rsp)
jmp 0xa1b05
movq 0x88(%rsp), %rdi
leaq 0x127d9(%rip), %rsi     # 0xb42ed
callq 0x8400
jmp 0xa1b1b
jmp 0xa1ed4
jmp 0xa1b22
callq 0x90ab0
movq %rax, 0x80(%rsp)
jmp 0xa1b31
movq 0x80(%rsp), %rax
movq %rax, 0x458(%rsp)
movq 0x458(%rsp), %rax
movq %rax, 0x70(%rsp)
leaq 0x417(%rsp), %rdi
movq %rdi, 0x78(%rsp)
callq 0x87f0
movq 0x78(%rsp), %rdx
leaq 0x11235(%rip), %rsi     # 0xb2da1
leaq 0x418(%rsp), %rdi
callq 0x85b0
jmp 0xa1b7b
leaq 0x3ef(%rsp), %rdi
movq %rdi, 0x68(%rsp)
callq 0x87f0
movq 0x68(%rsp), %rdx
leaq 0x11215(%rip), %rsi     # 0xb2dae
leaq 0x3f0(%rsp), %rdi
callq 0x85b0
jmp 0xa1ba8
movq 0x70(%rsp), %rsi
leaq 0x438(%rsp), %rdi
leaq 0x418(%rsp), %rdx
leaq 0x3f0(%rsp), %rcx
callq 0x909d0
jmp 0xa1bcc
leaq 0x3f0(%rsp), %rdi
callq 0x88f8
jmp 0xa1bdb
leaq 0x3ef(%rsp), %rdi
callq 0x84a0
leaq 0x418(%rsp), %rdi
callq 0x88f8
jmp 0xa1bf7
leaq 0x417(%rsp), %rdi
callq 0x84a0
leaq 0x790(%rsp), %rax
movq %rax, 0x58(%rsp)
leaq 0x438(%rsp), %rdi
callq 0x8190
movq %rax, 0x60(%rsp)
jmp 0xa1c25
movq 0x60(%rsp), %rdx
movq 0x58(%rsp), %rdi
movq 0x778(%rsp), %rcx
movl $0xc8, %esi
callq 0x82e0
cmpq $0x0, %rax
jne 0xa1e22
movq 0xc8(%rsp), %rax
cmpl $0x4, 0x208(%rax)
je 0xa1d91
leaq 0xd0(%rsp), %rdi
movl $0x4, %esi
callq 0xa1800
jmp 0xa1c74
leaq 0x1114a(%rip), %rsi     # 0xb2dc5
leaq 0xd0(%rsp), %rdi
callq 0x945b0
movq %rax, 0x50(%rsp)
jmp 0xa1c8f
movq 0x50(%rsp), %rdi
leaq 0x438(%rsp), %rsi
callq 0x8350
movq %rax, 0x48(%rsp)
jmp 0xa1ca8
movq 0x48(%rsp), %rdi
leaq 0x11132(%rip), %rsi     # 0xb2de6
callq 0x8400
jmp 0xa1cbb
leaq 0xd0(%rsp), %rdi
callq 0xa1f50
jmp 0xa1cca
jmp 0xa1e1d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x880(%rsp)
movl %eax, 0x87c(%rsp)
jmp 0xa1d3e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x880(%rsp)
movl %eax, 0x87c(%rsp)
jmp 0xa1d20
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x880(%rsp)
movl %eax, 0x87c(%rsp)
leaq 0x3f0(%rsp), %rdi
callq 0x88f8
jmp 0xa1d1e
jmp 0xa1d20
leaq 0x3ef(%rsp), %rdi
callq 0x84a0
leaq 0x418(%rsp), %rdi
callq 0x88f8
jmp 0xa1d3c
jmp 0xa1d3e
leaq 0x417(%rsp), %rdi
callq 0x84a0
jmp 0xa1eed
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x880(%rsp)
movl %eax, 0x87c(%rsp)
jmp 0xa1edc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x880(%rsp)
movl %eax, 0x87c(%rsp)
leaq 0xd0(%rsp), %rdi
callq 0xa1f50
jmp 0xa1d8c
jmp 0xa1edc
movq 0xc8(%rsp), %rdi
addq $0x8, %rdi
leaq 0x10ff4(%rip), %rsi     # 0xb2d98
callq 0x8400
movq %rax, 0x40(%rsp)
jmp 0xa1db0
movq 0x40(%rsp), %rdi
movq 0x780(%rsp), %rsi
callq 0x8400
movq %rax, 0x38(%rsp)
jmp 0xa1dc9
movq 0x38(%rsp), %rdi
leaq 0x12518(%rip), %rsi     # 0xb42ed
callq 0x8400
movq %rax, 0x30(%rsp)
jmp 0xa1de1
movq 0xc8(%rsp), %rax
movl 0x208(%rax), %edi
callq 0xa0cb0
movq 0x30(%rsp), %rdi
movq %rax, %rsi
callq 0x8400
movq %rax, 0x28(%rsp)
jmp 0xa1e08
movq 0x28(%rsp), %rdi
leaq 0x124d9(%rip), %rsi     # 0xb42ed
callq 0x8400
jmp 0xa1e1b
jmp 0xa1e1d
jmp 0xa1ec5
movq 0xc8(%rsp), %rdi
addq $0x8, %rdi
leaq 0x790(%rsp), %rsi
callq 0x8400
movq %rax, 0x20(%rsp)
jmp 0xa1e42
movq 0x20(%rsp), %rdi
leaq 0x10f4a(%rip), %rsi     # 0xb2d98
callq 0x8400
movq %rax, 0x18(%rsp)
jmp 0xa1e5a
movq 0x18(%rsp), %rdi
movq 0x780(%rsp), %rsi
callq 0x8400
movq %rax, 0x10(%rsp)
jmp 0xa1e73
movq 0x10(%rsp), %rdi
leaq 0x1246e(%rip), %rsi     # 0xb42ed
callq 0x8400
movq %rax, 0x8(%rsp)
jmp 0xa1e8b
movq 0xc8(%rsp), %rax
movl 0x208(%rax), %edi
callq 0xa0cb0
movq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x8400
movq %rax, (%rsp)
jmp 0xa1eb1
movq (%rsp), %rdi
leaq 0x12431(%rip), %rsi     # 0xb42ed
callq 0x8400
jmp 0xa1ec3
jmp 0xa1ec5
leaq 0x438(%rsp), %rdi
callq 0x88f8
jmp 0xa1ed4
addq $0x898, %rsp            # imm = 0x898
retq
leaq 0x438(%rsp), %rdi
callq 0x88f8
jmp 0xa1eeb
jmp 0xa1eed
movq 0xc0(%rsp), %rdi
callq 0x8650
jmp 0xa1efc
jmp 0xa1efe
movq 0xc8(%rsp), %rdi
leaq 0x2dd8b(%rip), %rsi     # 0xcfc98
callq 0x83f0
jmp 0xa1f14
jmp 0xa1f16
movq 0xc8(%rsp), %rdi
addq $0x210, %rdi            # imm = 0x210
callq 0x8800
jmp 0xa1f2c
jmp 0xa1f2e
movq 0x880(%rsp), %rdi
callq 0x87d0
movq %rax, %rdi
callq 0x8cf60
nopw %cs:(%rax,%rax)