// Copyright 2025 International Digital Economy Academy
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

///|
fn[T : Debug] debug_show_output(value : T, logger : &Logger) -> Unit {
  logger.write_string(@debug.to_string(value))
}

///|
pub impl Show for Signal with fn output(self, logger) {
  debug_show_output(self, logger)
}

///|
pub impl Show for Pid with fn output(self, logger) {
  debug_show_output(self, logger)
}

///|
pub impl Show for Uid with fn output(self, logger) {
  debug_show_output(self, logger)
}

///|
pub impl Show for Gid with fn output(self, logger) {
  debug_show_output(self, logger)
}

///|
pub impl Show for DiskUsage with fn output(self, logger) {
  debug_show_output(self, logger)
}

///|
pub impl Show for LoadAvg with fn output(self, logger) {
  debug_show_output(self, logger)
}

///|
pub impl Show for CGroupLimits with fn output(self, logger) {
  debug_show_output(self, logger)
}

///|
pub impl Show for ProcessStatus with fn output(self, logger) {
  debug_show_output(self, logger)
}

///|
pub impl Show for ThreadKind with fn output(self, logger) {
  debug_show_output(self, logger)
}

///|
pub impl Show for UpdateKind with fn output(self, logger) {
  debug_show_output(self, logger)
}

///|
pub impl Show for KillError with fn output(self, logger) {
  debug_show_output(self, logger)
}

///|
pub impl Show for DiskKind with fn output(self, logger) {
  debug_show_output(self, logger)
}

///|
pub impl Show for MacAddr with fn output(self, logger) {
  debug_show_output(self, logger)
}

///|
pub impl Show for IpNetwork with fn output(self, logger) {
  debug_show_output(self, logger)
}

///|
pub impl Show for ProcessesToUpdate with fn output(self, logger) {
  debug_show_output(self, logger)
}

///|
pub impl Show for ExitStatus with fn output(self, logger) {
  debug_show_output(self, logger)
}

///|
pub impl Show for Cpu with fn output(self, logger) {
  debug_show_output(self, logger)
}

///|
pub impl Show for Process with fn output(self, logger) {
  debug_show_output(self, logger)
}

///|
pub impl Show for Disk with fn output(self, logger) {
  debug_show_output(self, logger)
}

///|
pub impl Show for NetworkData with fn output(self, logger) {
  debug_show_output(self, logger)
}

///|
pub impl Show for Component with fn output(self, logger) {
  debug_show_output(self, logger)
}

///|
pub impl Show for Group with fn output(self, logger) {
  debug_show_output(self, logger)
}

///|
pub impl Show for User with fn output(self, logger) {
  debug_show_output(self, logger)
}

///|
pub impl Show for ProcessRefreshKind with fn output(self, logger) {
  debug_show_output(self, logger)
}

///|
pub impl Show for CpuRefreshKind with fn output(self, logger) {
  debug_show_output(self, logger)
}

///|
pub impl Show for MemoryRefreshKind with fn output(self, logger) {
  debug_show_output(self, logger)
}

///|
pub impl Show for RefreshKind with fn output(self, logger) {
  debug_show_output(self, logger)
}

///|
pub impl Show for DiskRefreshKind with fn output(self, logger) {
  debug_show_output(self, logger)
}

///|
pub impl Show for CpuSnapshot with fn output(self, logger) {
  debug_show_output(self, logger)
}

///|
pub impl Show for Disks with fn output(self, logger) {
  debug_show_output(self, logger)
}

///|
pub impl Show for DiskIoSnapshot with fn output(self, logger) {
  debug_show_output(self, logger)
}

///|
pub impl Show for MacosDiskInfo with fn output(self, logger) {
  debug_show_output(self, logger)
}

///|
pub impl Show for MountEntry with fn output(self, logger) {
  debug_show_output(self, logger)
}

///|
pub impl Show for Networks with fn output(self, logger) {
  debug_show_output(self, logger)
}

///|
pub impl Show for Components with fn output(self, logger) {
  debug_show_output(self, logger)
}

///|
pub impl Show for Users with fn output(self, logger) {
  debug_show_output(self, logger)
}

///|
pub impl Show for Groups with fn output(self, logger) {
  debug_show_output(self, logger)
}

///|
pub extend CGroupLimits with Show::{to_string, output}

///|
pub extend Component with Show::{to_string, output}

///|
pub extend Components with Show::{to_string, output}

///|
pub extend Cpu with Show::{to_string, output}

///|
pub extend CpuRefreshKind with Show::{to_string, output}

///|
pub extend CpuSnapshot with Show::{to_string, output}

///|
pub extend Disk with Show::{to_string, output}

///|
pub extend DiskIoSnapshot with Show::{to_string, output}

///|
pub extend DiskKind with Show::{to_string, output}

///|
pub extend DiskRefreshKind with Show::{to_string, output}

///|
pub extend DiskUsage with Show::{to_string, output}

///|
pub extend Disks with Show::{to_string, output}

///|
pub extend ExitStatus with Show::{to_string, output}

///|
pub extend Gid with Show::{to_string, output}

///|
pub extend Group with Show::{to_string, output}

///|
pub extend Groups with Show::{to_string, output}

///|
pub extend IpNetwork with Show::{output}

///|
pub extend KillError with Show::{to_string, output}

///|
pub extend LoadAvg with Show::{to_string, output}

///|
pub extend MacAddr with Show::{output}

///|
pub extend MacosDiskInfo with Show::{to_string, output}

///|
pub extend MemoryRefreshKind with Show::{to_string, output}

///|
pub extend MountEntry with Show::{to_string, output}

///|
pub extend NetworkData with Show::{to_string, output}

///|
pub extend Networks with Show::{to_string, output}

///|
pub extend Pid with Show::{to_string, output}

///|
pub extend Process with Show::{to_string, output}

///|
pub extend ProcessRefreshKind with Show::{to_string, output}

///|
pub extend ProcessStatus with Show::{to_string, output}

///|
pub extend ProcessesToUpdate with Show::{to_string, output}

///|
pub extend RefreshKind with Show::{to_string, output}

///|
pub extend Signal with Show::{to_string, output}

///|
pub extend ThreadKind with Show::{to_string, output}

///|
pub extend Uid with Show::{to_string, output}

///|
pub extend UpdateKind with Show::{to_string, output}

///|
pub extend User with Show::{to_string, output}

///|
pub extend Users with Show::{to_string, output}