Received: from mail-ed1-f68.google.com (mail-ed1-f68.google.com [209.85.208.68]) by mail.sr.ht (Postfix) with ESMTPS id 96A5B40113 for <~eliasnaur/gio-patches@lists.sr.ht>; Mon, 13 Jan 2020 13:20:04 +0000 (UTC) Authentication-Results: mail.sr.ht; dkim=pass (2048-bit key) header.d=eliasnaur.com header.i=@eliasnaur.com header.b=pPpNecEJ Received: by mail-ed1-f68.google.com with SMTP id b8so8419468edx.7 for <~eliasnaur/gio-patches@lists.sr.ht>; Mon, 13 Jan 2020 05:20:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eliasnaur.com; s=google; h=content-transfer-encoding:in-reply-to:date:cc:subject:from:to :message-id; bh=Q9lpuDFR59JRgix9VbFcIWh/ptVAFN3KBizg+smodVQ=; b=pPpNecEJl6x1vsPfs8v2UVe1J/2xlgFLSzLNqfZ90/B/YsJY1s0Ln5xwoDLzUbFnV8 y15mDt3X9FdT6n4mdhaWQ+qu0soNGTyOOqsUSzelCTCsnlhE39vW2hNuHcdo94MtjYQu iWr5TXSUkHQT0qBE8XD9QbpfnGuPxlnMuPsQHbYn031z7onbHRC2FjGtf41/JbI1fxZM nZg/r0WkHwg5B5ijYgJ5eyYCKScwhMSVDNb7SgsUilBHaBKk1hZTg1ac7An/W3+B54IY 8B94K/hpBYcrH6oCmVzhrGDWtHTrtGTIE29ZsIz/6bRNJEAn1SpyAM+SxoSE0D8IkCU+ KcUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:content-transfer-encoding:in-reply-to:date:cc :subject:from:to:message-id; bh=Q9lpuDFR59JRgix9VbFcIWh/ptVAFN3KBizg+smodVQ=; b=Oqpu8jEqBIe2SuSba5MafYdIbVOeUNr1E3PBkoEsJ7aaIDcuuUQmdvwEYua7kKCQpn ghxhW/r/KMkGaETUKGvOCiNYAoB33QTlZjomxB1pFYx7sw/U3bGRCnlTI4kIyOV8m5bs 8BBuBsHD9eyS5eSTUGZ5hEUmrxRsPqmacD2EArcBythuk1ExQyqfecOzPKlfQyPU9sOH CaOQE4k7J0FRaomh1VyiLCn7J/j0sCtSiDY0OjnwfK1Pi4PmTfvXdsZr35/5MofArZ82 9AIs0SYIGe+okGuxXP4Tl3DHv+z87XlFwfekwOKmU851o5Bex+zsB1uw0C8YQlYNSeu3 iv9A== X-Gm-Message-State: APjAAAVCP0O+Bj+3MPJXvkHdT7K8NA7OCLqTKp3THUIEv9li1rK0vFRA hWZmpG7ElHumZaYPohUzVS8Y9CEhhj0= X-Google-Smtp-Source: APXvYqybSidK3A/vurPPaTM+BIV6gW+ZycydNMgHB+Zj/A4rtLGYAhnhAlJ8rsSRLjeNRcQViNAGjA== X-Received: by 2002:a17:906:260b:: with SMTP id h11mr16638006ejc.327.1578921603481; Mon, 13 Jan 2020 05:20:03 -0800 (PST) Received: from localhost ([145.255.60.245]) by smtp.gmail.com with ESMTPSA id a9sm422519edm.82.2020.01.13.05.20.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 13 Jan 2020 05:20:02 -0800 (PST) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 In-Reply-To: <20200113114355.17505-1-mural@ctli.io> Date: Mon, 13 Jan 2020 14:18:23 +0100 Cc: "mural" Subject: Re: [gio v1] app/internal/log: add logger for Windows DebugView From: "Elias Naur" To: "mural" , <~eliasnaur/gio-patches@lists.sr.ht> Message-Id: On Mon Jan 13, 2020 at 7:43 PM, mural wrote: > Signed-off-by: mural > --- > According to > https://docs.microsoft.com/en-us/windows/console/getstdhandle, > GetStdHandle would return NULL if there is no associated standard > handles. > So we chack 0 as well. > >=20 > app/internal/log/log_windows.go | 34 +++++++++++++++++++++++++++++++++ > 1 file changed, 34 insertions(+) > create mode 100644 app/internal/log/log_windows.go > >=20 > diff --git a/app/internal/log/log_windows.go > b/app/internal/log/log_windows.go > new file mode 100644 > index 0000000..0642919 > --- /dev/null > +++ b/app/internal/log/log_windows.go > @@ -0,0 +1,34 @@ > + // Windows DebugView already includes timestamps. > + if syscall.Stderr =3D=3D 0 || syscall.Stderr =3D=3D syscall.InvalidHand= le { Your commit message implies that 0 is returned for unattached I/O. If so, please remove the InvalidHandle check which will only confuse future readers.