drop official logging

This commit is contained in:
Daylin Morgan 2024-01-28 12:08:38 -06:00
parent f35481f6bf
commit b07f50a77a
Signed by: daylin
GPG key ID: C1E52E7DD81DF79F

View file

@ -1,11 +1,26 @@
import std/[logging, os, osproc, tables, times] import std/[os, osproc, tables, times, strutils, terminal]
from std/nativesockets import getHostname from std/nativesockets import getHostname
var logger = newConsoleLogger()
addHandler(logger)
let summaryFile = getEnv("GITHUB_STEP_SUMMARY") let summaryFile = getEnv("GITHUB_STEP_SUMMARY")
proc info(args: varargs[string, `$`]) =
stdout.styledWriteLine(
fgCyan, "oizys", resetStyle, "|",
styleDim, "INFO", resetStyle, "| ",
args.join("")
)
proc error(args: varargs[string, `$`]) =
stdout.styledWriteLine(
fgCyan, "oizys", resetStyle, "|",
styleDim, "ERROR", resetStyle, "| ",
args.join("")
)
proc execQuit(cmd: string) =
quit (execCmd cmd)
type type
OizysContext = object OizysContext = object
flake, host: string flake, host: string
@ -20,9 +35,6 @@ proc newCtx(): OizysContext =
proc systemFlakePath(c: OizysContext): string = proc systemFlakePath(c: OizysContext): string =
c.flake & "#nixosConfigurations." & c.host & ".config.system.build.toplevel" c.flake & "#nixosConfigurations." & c.host & ".config.system.build.toplevel"
proc execQuit(cmd: string) =
quit (execCmd cmd)
proc build(c: OizysContext) = proc build(c: OizysContext) =
## build nixos ## build nixos
let let
@ -34,7 +46,6 @@ proc dry(c: OizysContext) =
execQuit "nix build " & c.systemFlakePath & " --dry-run" execQuit "nix build " & c.systemFlakePath & " --dry-run"
proc cache(c: OizysContext) = proc cache(c: OizysContext) =
# Simple benchmarking
let start = cpuTime() let start = cpuTime()
let code = execCmd """ let code = execCmd """
cachix watch-exec """ & c.cache & """ \ cachix watch-exec """ & c.cache & """ \