summaryrefslogtreecommitdiff
path: root/src/Logger.h
Commit message (Collapse)AuthorAgeFilesLines
* Added --console-log-level optionTatsuhiro Tsujikawa2013-01-051-5/+19
| | | | --console-log-level option sets log level to output to console.
* Console color outputTatsuhiro Tsujikawa2012-12-081-0/+1
| | | | Log level and download result string is now colored.
* Use global::cout to output string to stdout.Tatsuhiro Tsujikawa2011-08-091-3/+4
| | | | | | | In MinGW32 build, global::cout is WinConsoleFile. When outputing to console, it uses WriteConsoleW, so Unicode characters are written. Fixed memory leak in WChar<->MultiByte conversion functions. The portion of code which uses std::cout is rewritten to use global::cout.
* Rewritten Logger using BufferedFile.Tatsuhiro Tsujikawa2011-08-071-2/+12
|
* 2010-11-20 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-11-201-65/+4
| | | | | | | | | | | | Made LogFactory::logger_ as SharedHandle<Logger> to make dtor of Logger called at the program exit. Rewritten A2_LOG_* macro and moved them to LogFactory.h * src/LogFactory.cc * src/LogFactory.h * src/Logger.cc * src/Logger.h
* 2010-11-20 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-11-201-67/+93
| | | | | | | Rewritten Logger interface. Logger now writes source file name and line number in log file.
* 2010-11-14 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-11-141-8/+2
| | | | | | | | | Added .cc file for classes/structs that only provided by header file. Defined non-POD classes' ctor, dtor in .cc file. Moved implementation code in header file to .cc file for major classes/strucsts.
* 2010-10-31 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-10-311-3/+3
| | | | | | Made #include guard consistent for c++ header files.
* 2010-10-27 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-10-271-10/+20
| | | | | | | Added printf format check attribute. * src/Logger.h * src/StringFormat.h
* 2010-06-23 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-06-231-5/+10
| | | | | | | | | | | | | | | | | | | | | | | Made log and log-level option modifiable using aria2.changeGlobalOption. This means you can dynamically start or stop logging and change log file and log level. * doc/aria2c.1.txt * src/LogFactory.cc * src/LogFactory.h * src/LogFormatter.h * src/Logger.cc * src/Logger.h * src/Makefile.am * src/Makefile.in * src/SimpleLogFormatter.cc * src/SimpleLogFormatter.h * src/SimpleLogger.cc: Removed * src/SimpleLogger.h: Removed * src/XmlRpcMethod.cc * src/XmlRpcMethodImpl.cc * src/main.cc
* 2010-06-21 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-06-211-5/+5
| | | | | | | Changed naming standards for class member variable: now it looks like var_ instead of _var.
* 2010-06-20 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-06-201-85/+12
| | | | | | | | Moved non-trivial functions to *.cc file * src/Logger.cc * src/Logger.h
* 2010-04-16 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-04-161-17/+17
| | | | | | | | | | | | | Fixed compile error with openssl 1.1.0 and mingw32. * src/AsyncNameResolver.cc * src/LogFactory.cc * src/Logger.cc * src/Logger.h * src/SocketCore.cc * src/SocketCore.h * src/a2netcompat.h
* 2010-04-12 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-04-111-3/+3
| | | | | | | | | Fixed compile error on opensolaris * configure.ac * src/Logger.h * src/GZipEncoder.h
* 2010-03-02 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-03-011-1/+11
| | | | | | | | | | Avoid costly BtMessage::toString() if info level log is not required. * src/DefaultBtInteractive.cc * src/Logger.h * src/SimpleBtMessage.cc
* 2010-02-09 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-02-091-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Wrapped logger->debug(...) with if(logger->debug()) { ... } * src/AbstractCommand.cc * src/AdaptiveURISelector.cc * src/BtPieceMessage.cc * src/BtPortMessage.cc * src/CreateRequestCommand.cc * src/DHTAbstractNodeLookupTask.cc * src/DHTBucket.cc * src/DHTGetPeersCommand.cc * src/DHTMessageDispatcherImpl.cc * src/DHTMessageFactoryImpl.cc * src/DHTMessageTracker.cc * src/DHTPeerAnnounceStorage.cc * src/DHTRoutingTable.cc * src/DHTSetup.cc * src/DefaultBtAnnounce.cc * src/DefaultBtInteractive.cc * src/DefaultBtMessageDispatcher.cc * src/DefaultBtMessageReceiver.cc * src/DefaultBtProgressInfoFile.cc * src/DefaultBtRequestFactory.cc * src/DefaultPeerStorage.cc * src/DefaultPieceStorage.cc * src/DownloadCommand.cc * src/DownloadEngine.cc * src/EpollEventPoll.cc * src/FileAllocationCommand.cc * src/FileEntry.cc * src/FtpNegotiationCommand.cc * src/HandshakeExtensionMessage.cc * src/HttpListenCommand.cc * src/HttpServer.cc * src/HttpSkipResponseCommand.cc * src/IteratableChunkChecksumValidator.cc * src/Logger.h * src/MSEHandshake.cc * src/MetalinkPostDownloadHandler.cc * src/MultiDiskAdaptor.cc * src/PeerAbstractCommand.cc * src/PeerConnection.cc * src/PeerListenCommand.cc * src/PeerReceiveHandshakeCommand.cc * src/RequestGroup.cc * src/RequestGroupMan.cc * src/SegmentMan.cc * src/SelectEventPoll.cc * src/ServerStat.cc * src/SimpleBtMessage.cc * src/SocketCore.cc * src/TrackerWatcherCommand.cc * src/UTMetadataDataExtensionMessage.cc * src/UTMetadataRequestFactory.cc * src/UTMetadataRequestTracker.cc * src/XmlRpcMethod.cc
* 2010-01-06 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-01-051-36/+36
| | | | | | | | | Untabify. Fixed one line in copyright which is longer than 80 columns. * src * test
* 2009-07-18 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2009-07-181-13/+136
| | | | | | | | | | | | | | Rewritten Logger to avoiding constly virtual call. * src/LogFactory.cc * src/LogFactory.h * src/Logger.h * src/Makefile.am * src/Makefile.in * src/NullLogger.h: Removed. * src/SimpleLogger.cc * src/SimpleLogger.h
* 2008-05-16 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-05-151-0/+2
| | | | | | | | | | | | | | | | | | Added --log-level option to specify log level. Log messages under the specified level are not output. Default value is `debug'. * src/HelpItemFactory.cc * src/LogFactory.cc * src/LogFactory.h * src/Logger.h * src/OptionHandlerFactory.cc * src/SimpleLogger.cc * src/SimpleLogger.h * src/main.cc * src/option_processing.cc * src/prefs.h * src/usage_text.h
* 2008-05-10 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-05-101-5/+5
| | | | | | | | | Added const qualifier to argument Exception& e. * src/Logger.h * src/SimpleLogger.cc * src/SimpleLogger.h
* 2008-04-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-04-271-5/+5
| | | | | | | | | | | | | Rewritten Exception class. Throw exception object, not its pointer and catch by reference, so that remove problematic delete operator for catched exception. * src/Exception.cc * src/Exception.h * test/ExceptionTest.cc * src/*: All files throwing/catching exception. * test/*: All files throwing/catching exception.
* 2008-04-26 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-04-261-10/+10
| | | | | | | | | | | | | | | | | | | | | | Added StringFormat class, which internally calls vasprintf. operator<< is defined for this class, so it can be used with iostream classes nicely. SimpleLogger and following functions are rewritten using StringFormat class. Besides, now Logger class's methods are non-const, many classes that has a const Logger* as a member variable are modified to remove const qualifier from the variable declaration. * src/HelpItemFactory.cc * src/Request.cc * src/SimpleLogger.cc * src/StringFormat.cc * src/StringFormat.h * src/Util.cc * src/option_processing.cc * src/version_usage.cc * test/StringFormatTest.cc * src/*.h: The classes that has const Logger* as a member variable.
* 2008-02-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-02-081-3/+5
| | | | | | | | | Removed "using namespace std;" from all sources. Appended std:: prefix to c++ standard classes. Included string.h where mem* function are used.
* 2006-09-22 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2006-09-211-2/+15
| | | | | | | | * src/*.{h,cc}: Added an exception to the license which allows linking with OpenSSL.
* 2006-08-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2006-08-271-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To add --seed-time and --seed-ratio command-line option: * src/Option.h (getAsDouble): New function. * src/Option.cc (getAsDouble): New function. * src/SeedCheckCommand.h: New class. * src/SeedCheckCommand.cc: New class. * src/DownloadEngineFactory.cc (SeedCheckCommand.h): Included. (UnionSeedCriteria.h): Included. (TimeSeedCriteria.h): Included. (ShareRatioSeedCriteria.h): Included. (newTorrentConsoleEngine): Added the processing of seed option. * src/SeedCriteria.h: New class. * src/ShareRatioSeedCriteria.h: New class. * src/TimeSeedCriteria.h: New class. * src/UnionSeedCriteria.h: New class. * src/prefs.h (PREF_SEED_TIME): New definition. (PREF_SEED_RATIO): New definition. * src/main.cc (showUsage): Added --seed-time and --seed-ratio option. (main): Added --seed-time and --seed-ratio option. Made default log file name "/dev/null". * src/SharedHandle.h (SharedHandle): Copy constructor. Made it assignable from the SharedHandle of the subclasses. (operator=): Made it assignable from the SharedHandle of the subclasses. (getRefCount): New function. To add notice log level and the switch to write log to stdout. This switch is configurable per log level. * src/Logger.h (notice): New function. (LEVEL): Added NOTICE. Assigned an explicit value to each log level constant. * src/LogFactory.cc (getInstance): The use of NullLogger was removed. A log message with notice log level was made written to stdout along with log file. * src/NullLogger.h (notice): New function. * src/SimpleLogger.h (writeHeader): Added the 'file' argument. (writeLog): Added the 'file' argument. (writeFile): New function. (stdoutField): New variable. (SimpleLogger): Removed the default constructor. (SimpleLogger): Made the default value of logfile 0. (debug): Added 'virtual' keyword. (info): Added 'virtual' keyword. (warn): Added 'virtual' keyword. (error): Added 'virtual' keyword. (notice): New function. (setStdout): New function. * src/SimpleLogger.cc (WRITE_LOG): Replaced writeLog with writeFile. (WRITE_LOG_EX): Replaced writeLog with writeFile. (SimpleLogger): Removed the default constructor. (setStdout): New function. (writeLog): Added the handling of NOTICE log level. (writeFile): New function. (notice): New function. * src/TorrentMan.h: Updated doc. * src/BitfieldMan.h: Updated doc. * src/TrackerWatcherCommand.cc (execute): Return true if error occurred in the request to the tracker and halt is requested. * src/TrackerUpdateCommand.cc (execute): Return true if error occurred in the request to the tracker and halt is requested. * src/TorrentConsoleDownloadEngine.h (onSelectiveDownloadingCompletes): Removed. * src/TorrentConsoleDownloadEngine.cc (onSelectiveDownloadingCompletes): Removed. * src/TorrentDownloadEngine.h (onEndOfRun): Added 'virtual' keyword. (afterEachIteration): Removed. (onSelectiveDownloadingCompletes): Removed. * src/TorrentDownloadEngine.cc (onEndOfRun): Removed filenameFixed. (afterEachIteration): Removed. * src/TorrentMan.cc (completePiece): Call onDownloadComplete here. (onDownloadComplete): Added 2 log messages.
* 2006-03-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2006-03-271-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * configure.in: Added gnutls support. Added several CPP macros. * m4/openssl.m4: Added. * src/SocketCore.{h,cc}: Drop const quarifier from writeData(), readData(), peekData(). Added gnutls support. * src/HttpDownloadCommand.cc: Removed SleepCommand.h * src/TrackerWatcherCommand.{h,cc}: Added. This command creates TrackerInitCommand periodicaly(TorrentMan::minInterval). * src/TorrentMan.cc: Remove downloadedSize == 0 check from save(). Instead, added a check for whether setup method has executed successfully. * src/TorrentMan.h: Added member vaiable setupComplete. Updated DEFAULT_ANNOUNCE_INTERVAL and DEFAULT_ANNOUNCE_MIN_INTERVAL to 300. * src/Makefile.am: Updated. * src/messageDigest.h: Added. This is a macro calculating SHA1 digest using whether OpenSSL or gcrypt, depending on the result of configure script. * src/ShaVisitor.{h,cc}: Removed direct dependency on OpenSSL by using messageDigest.h. * src/TorrentAutoSaveCommand.h: Removed unused variable cuid. * src/PeerListenCommand.cc: Added log about port binded successfully. Fixed memory leak. * src/main.cc: Added gnutls support. Replaced LIB_SSL with ENABLE_BITTORRENT where they are not related to OpenSSL but BitTorrent. Removed instantiation of TrackerInitCommand. Instead, TrackerWatcherCommand is instantiated and pushed to the command queue. * src/InitiateConnectionCommandFactory.cc: Replaced HAVE_LIBSSL with ENABLE_SSL. * src/Request.cc: Replaced HAVE_LIBSSL with ENABLE_SSL. * src/RequestSlotMan.cc: (deleteCompletedRequestSlot) If a piece is already acquired by another command, delete the request slots for the piece. * src/TrackerUpdateCommand.cc: (execute) Changed log level of MSG_TRACKER_WARNING_MESSAGE from info to warn. Added a check whether peer list is null. Fixed the bug that causes sending completed event to the tracker several times. * src/TrackerInitCommand.cc: (execute) Fixed the bug that causes sending completed event to the tracker several times. * src/AbstractDiskWriter.{h,cc}: Removed direct dependency on OpenSSL by using messageDigest.h. 2006-03-26 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> * PeerConnection.cc: Replaced log message "keep-alive" with "keep alive". * PeerInteractionCommand.{h,cc}: Close connection if peer is choking localhost long time. * TorrentMan.cc: When adding new peer with duplicate = true, if the number of peer list is equal to or grater than MAX_PEER_LIST, delete at most 100 failure entry from the list. If with duplicate = false, MAX_PEER_LIST is not checked. * PeerListenCommand.cc: Fixed the argument order of log message. 2006-03-25 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> * Logger.h: Moved enum LEVEL from SimpleLogger.h to here. Added warn(). * SimpleLogger.h: Moved enum LEVEL to Logger.h. Implemented warn(). Defined 2 macros(WRITE_LOG, WRITE_LOG_EX) to avoid duplicated code.
* * Logger.h:Tatsuhiro Tsujikawa2006-03-011-6/+6
| | | | | | * SimpleLogger.{h,cc}: Changed the type of msg to const char*.
* * Util.{h,cc}: added startsWith().Tatsuhiro Tsujikawa2006-02-281-0/+2
| | | | | | | | | | | | | | | | | | * CookieBox.cc: rewrited criteriaFind() using Util::startsWith() and Util::endsWith(). * SocketCore.cc: struct addrinfo is now zero-initialized. * common.h: added #include directive of limit.h. * DownloadEngine.cc: added #include directive of sys/time.h and algorithm. * Exception.h: added #include directive of stdio.h. * AbstractCommand.h: added #include directive of sys/time.h. * DownloadCommand.h: added #include directive of sys/time.h. * *.h: added #include directive of common.h to all base classes. subclasses' one was removed.
* (no commit message)Tatsuhiro Tsujikawa2006-02-211-6/+6
|
* Initial importTatsuhiro Tsujikawa2006-02-171-0/+40