Changeset 3048 for box/trunk/lib


Ignore:
Timestamp:
12/12/2011 23:36:25 (5 months ago)
Author:
chris
Message:

Log the account name with connections, disconnections and statistics, requested by Pete Jalajas.

Location:
box/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • box/trunk

  • box/trunk/lib/backupstore/BackupCommands.cpp

    r2983 r3048  
    9090        { 
    9191                BOX_WARNING("Failed login from client ID " <<  
    92                         BOX_FORMAT_ACCOUNT(mClientID) << 
    93                         ": wrong certificate for this account"); 
     92                        BOX_FORMAT_ACCOUNT(mClientID) << ": " 
     93                        "wrong certificate for this account"); 
    9494                return PROTOCOL_ERROR(Err_BadLogin); 
    9595        } 
     
    9898        { 
    9999                BOX_WARNING("Failed login from client ID " <<  
    100                         BOX_FORMAT_ACCOUNT(mClientID) << 
    101                         ": no such account on this server"); 
     100                        BOX_FORMAT_ACCOUNT(mClientID) << ": " 
     101                        "no such account on this server"); 
    102102                return PROTOCOL_ERROR(Err_BadLogin); 
    103103        } 
     
    129129        // Log login 
    130130        BOX_NOTICE("Login from Client ID " <<  
    131                 BOX_FORMAT_ACCOUNT(mClientID) << 
    132                 " " << 
     131                BOX_FORMAT_ACCOUNT(mClientID) << " " 
     132                "(name=" << rContext.GetAccountName() << "): " << 
    133133                (((mFlags & Flags_ReadOnly) != Flags_ReadOnly) 
    134134                ?"Read/Write":"Read-only")); 
     
    153153{ 
    154154        BOX_NOTICE("Session finished for Client ID " <<  
    155                 BOX_FORMAT_ACCOUNT(rContext.GetClientID())); 
     155                BOX_FORMAT_ACCOUNT(rContext.GetClientID()) << " " 
     156                "(name=" << rContext.GetAccountName() << ")"); 
    156157 
    157158        // Let the context know about it 
  • box/trunk/lib/backupstore/BackupStoreContext.h

    r2988 r3048  
    1616 
    1717#include "autogen_BackupProtocol.h" 
     18#include "BackupStoreInfo.h" 
    1819#include "BackupStoreRefCountDatabase.h" 
    1920#include "NamedLock.h" 
     
    2324class BackupStoreDirectory; 
    2425class BackupStoreFilename; 
    25 class BackupStoreInfo; 
    2626class IOStream; 
    2727class BackupProtocolMessage; 
     
    8181        void SaveStoreInfo(bool AllowDelay = true); 
    8282        const BackupStoreInfo &GetBackupStoreInfo() const; 
     83        const std::string GetAccountName() 
     84        { 
     85                if(!mapStoreInfo.get()) 
     86                { 
     87                        return "Unknown"; 
     88                } 
     89                return mapStoreInfo->GetAccountName(); 
     90        } 
    8391 
    8492        // Client marker 
Note: See TracChangeset for help on using the changeset viewer.