<commit_before>import debug from 'debug';
const logger = debug('Account');

class Account {
  loggedIn(loginToken, loginTokenExpires, userId) {
    try {
      logger('Init loggedIn');
      logger(`loginToken: ${loginToken} - loginTokenExpires: ${loginTokenExpires} - userId: ${userId}`);
      localStorage.setItem('Graphite.loginToken', loginToken);
      localStorage.setItem('Graphite.loginTokenExpires', loginTokenExpires);
      localStorage.setItem('Graphite.userId', userId);
      logger('Save in localStorage');
      const event = new CustomEvent('loggedIn', { detail: { loginToken, loginTokenExpires, userId } });
      window.dispatchEvent(event);
      logger('Trigger event');
    } catch (e) {
      logger('Error loggedIn: ', e);
    }
  }

  logout() {
    try {
      logger('Init logout');
      localStorage.removeItem('Graphite.loginToken');
      localStorage.removeItem('Graphite.userId');
      localStorage.removeItem('Graphite.loginTokenExpires');
      logger('Remove in localStorage');
      const event = new Event('logout');
      window.dispatchEvent(event);
      logger('Trigger event');
    } catch (e) {
      logger('Error logout: ', e);
    }
  }
}

export default new Account();<commit_msg>[REFACTOR] - logger<commit_after>import debug from 'debug';

class Account {
  logger = debug('Account');

  loggedIn(loginToken, loginTokenExpires, userId) {
    try {
      this.logger('Init loggedIn');
      this.logger(`loginToken: ${loginToken} - loginTokenExpires: ${loginTokenExpires} - userId: ${userId}`);
      localStorage.setItem('Graphite.loginToken', loginToken);
      localStorage.setItem('Graphite.loginTokenExpires', loginTokenExpires);
      localStorage.setItem('Graphite.userId', userId);
      this.logger('Save in localStorage');
      const event = new CustomEvent('loggedIn', { detail: { loginToken, loginTokenExpires, userId } });
      window.dispatchEvent(event);
      this.logger('Trigger event');
    } catch (error) {
      this.logger(`Error loggedIn: ${error.message}`);
    }
  }

  logout() {
    try {
      this.logger('Init logout');
      localStorage.removeItem('Graphite.loginToken');
      localStorage.removeItem('Graphite.userId');
      localStorage.removeItem('Graphite.loginTokenExpires');
      this.logger('Remove in localStorage');
      const event = new Event('logout');
      window.dispatchEvent(event);
      this.logger('Trigger event');
    } catch (error) {
      this.logger(`Error logout: ${error.message}`);
    }
  }
}

export default new Account();
{'fraction_non_alphanumeric': 0.14476789929189615, 'fraction_numerical': 0.0, 'mean_word_length': 3.735567970204842, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4810637', 'n_tokens_mistral': 728, 'n_tokens_neox': 743, 'n_words': 143}