Patchwork [5,of,5] loggingutil: document openlogfile()

login
register
mail settings
Submitter Yuya Nishihara
Date Nov. 30, 2018, 1:41 p.m.
Message ID <cca1069915a9dd052138.1543585288@mimosa>
Download mbox | patch
Permalink /patch/36882/
State Accepted
Headers show

Comments

Yuya Nishihara - Nov. 30, 2018, 1:41 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1542533731 -32400
#      Sun Nov 18 18:35:31 2018 +0900
# Node ID cca1069915a9dd0521384d3c8d9d981b2092f237
# Parent  9868f09e72ad134557db7af35b642afc1130d4c3
loggingutil: document openlogfile()

This function will be used later for command-server logging.

Patch

diff --git a/mercurial/loggingutil.py b/mercurial/loggingutil.py
--- a/mercurial/loggingutil.py
+++ b/mercurial/loggingutil.py
@@ -15,6 +15,10 @@  from . import (
 )
 
 def openlogfile(ui, vfs, name, maxfiles=0, maxsize=0):
+    """Open log file in append mode, with optional rotation
+
+    If maxsize > 0, the log file will be rotated up to maxfiles.
+    """
     def rotate(oldpath, newpath):
         try:
             vfs.unlink(newpath)